Rewrite .html to .php without HTACCESS?

Discussion in 'Site & Server Administration' started by hasen, Aug 25, 2009.

  1. #1
    Is there a way to do this:

    
    RewriteRule ^(.*)\.html$ $1.php [NC]
    
    Code (markup):
    on a Windows server? If not is there some way to do this by simply altering the header.php file with the same command written in php or javascript to perform this operation?
     
    hasen, Aug 25, 2009 IP
  2. Naico

    Naico Member

    Messages:
    24
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    40
    #2
    Naico, Aug 25, 2009 IP
  3. hasen

    hasen Peon

    Messages:
    994
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Ok I'll talk to my host but if that's not possible for whatever reason then is there any way to do it within the code in php or javascript?
     
    hasen, Aug 30, 2009 IP
  4. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #4
    You can do html redirects using this code

    <meta http-equiv="Refresh" content="5; url=http://www.quackit.com/html/tags.cfm">

    but u have to create individual page for all
     
    Bohra, Aug 30, 2009 IP
  5. picos

    picos Active Member

    Messages:
    155
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    81
    #5
    it is not a solution.
    in window server, you can install apache include mod_rewrite, It work also in *nix.
     
    picos, Aug 31, 2009 IP
  6. Active_Hosting

    Active_Hosting Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    did you manage to resolve the problem?
     
    Active_Hosting, Aug 31, 2009 IP
  7. hasen

    hasen Peon

    Messages:
    994
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Well no one has answered my second question about doing this purely within php or javascript. Other than having a different header for every page. The host won't/can't install isapi rewrite on the server so I can't really use these other options.
     
    hasen, Sep 1, 2009 IP