URL Rewriting mod_rewrite php to static link

Discussion in 'Site & Server Administration' started by FOX LORE, Jun 9, 2007.

  1. #1
    FOX LORE, Jun 9, 2007 IP
  2. bouncer69

    bouncer69 Peon

    Messages:
    978
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    0
    #2
    How you mean Static...You want it .html ?
     
    bouncer69, Jun 9, 2007 IP
  3. bouncer69

    bouncer69 Peon

    Messages:
    978
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You can use this

    Options +FollowSymLinks

    <IfModule mod_rewrite.c>

    RewriteEngine On

    RewriteRule bleeding.htm bleeding.php
    RewriteRule burnsandscalds.htm burnsandscalds.php

    </IfModule>
     
    bouncer69, Jun 9, 2007 IP
  4. FOX LORE

    FOX LORE Notable Member

    Messages:
    8,118
    Likes Received:
    408
    Best Answers:
    0
    Trophy Points:
    230
    #4
    Yes, like this: website-design/

    I added it to .htaccess but it did not work.

    What have I done worng?:confused:
     
    FOX LORE, Jun 9, 2007 IP
  5. bouncer69

    bouncer69 Peon

    Messages:
    978
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    0
    #5
    This should work. Do you have mode rewrite enabled with your hosting?

    Check with a phpinfo files

    <?php
    phpinfo();
    phpinfo(INFO_MODULES);

    ?>
     
    bouncer69, Jun 9, 2007 IP
  6. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #6
    Options +FollowSymLinks +Indexes
    RewriteEngine on
    RewriteBase /
    RewriteRule ^([^.]+)\.html$ $1.php [L]
     
    Nintendo, Jun 9, 2007 IP
  7. FOX LORE

    FOX LORE Notable Member

    Messages:
    8,118
    Likes Received:
    408
    Best Answers:
    0
    Trophy Points:
    230
    #7
    It didn't work. This is the htacess files what needs to be change?




    # -FrontPage-

    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*



    Options +FollowSymLinks +Indexes
    RewriteEngine on
    RewriteBase /
    RewriteRule ^([^.]+)\.html$ $1.php [L]


    Options +FollowSymLinks

    <IfModule mod_rewrite.c>

    RewriteEngine On

    RewriteRule bleeding.htm bleeding.php
    RewriteRule burnsandscalds.htm burnsandscalds.php

    </IfModule>





    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthName petsfirstaid.org
    AuthUserFile /home/petsfirs/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/petsfirs/public_html/_vti_pvt/service.grp
     
    FOX LORE, Jun 9, 2007 IP
  8. grandy

    grandy Banned

    Messages:
    239
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Can you please replae this code from your .htaccess:

    Options +FollowSymLinks +Indexes
    RewriteEngine on
    RewriteBase /
    RewriteRule ^([^.]+)\.html$ $1.php [L]
    
    
    Options +FollowSymLinks
    
    <IfModule mod_rewrite.c>
    
    RewriteEngine On
    
    RewriteRule bleeding.htm bleeding.php
    RewriteRule burnsandscalds.htm burnsandscalds.php
    
    </IfModule>
    
    Code (markup):
    with this:

    RewriteEngine on
    RewriteRule ^bleeding.html$ bleeding.php
    Code (markup):
    After adding the above lines you should be able to visit:
    http://www.petsfirstaid.org/bleeding.html

    Let me know.
     
    grandy, Jun 9, 2007 IP
  9. FOX LORE

    FOX LORE Notable Member

    Messages:
    8,118
    Likes Received:
    408
    Best Answers:
    0
    Trophy Points:
    230
    #9
    I add the code and is this what I was surpose to do? It didn't work.












    # -FrontPage-

    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*


    RewriteEngine on
    RewriteRule ^bleeding.html$ bleeding.php





    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthName petsfirstaid.org
    AuthUserFile /home/petsfirs/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/petsfirs/public_html/_vti_pvt/service.grp
     
    FOX LORE, Jun 9, 2007 IP
  10. grandy

    grandy Banned

    Messages:
    239
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #10
    http://www.petsfirstaid.org/bleeding.html

    Its working fine for me :confused:

    Isn't this thing what you are looking for?
     
    grandy, Jun 9, 2007 IP
  11. bouncer69

    bouncer69 Peon

    Messages:
    978
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Options +FollowSymLinks

    <IfModule mod_rewrite.c>

    RewriteEngine On

    RewriteRule bleeding.htm bleeding.php
    RewriteRule burnsandscalds.htm burnsandscalds.php

    </IfModule>


    Hi After adding this code on .htaccess file you have to change your menu with with .htm. It will not automatically change your menu links.
     
    bouncer69, Jun 10, 2007 IP