Automatically change .php request to .html on the URL bar.

Discussion in 'PHP' started by ceytimes, Apr 6, 2011.

  1. #1
    Guys I have write a mod rewrite to make SEO URLs.But .html pages are only coming to the title bar only if requested it.And if I request .php file it's showing .php extension on the URL bar.


    I need to change the .php request to .html on the address bar just like mod-rewrite change "domain.com" to www.domain.com" initially it request.

    "sample.php -> sample.html"

    I have seen this on some websites but hard to find the way to do it.

    Waiting for your help.
     
    ceytimes, Apr 6, 2011 IP
  2. leunamer

    leunamer Peon

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you might want to use the htaccess method,

    
    RewriteEngine on
    RewriteRule ^$.html        sample.php [L]
    
    Code (markup):
     
    leunamer, Apr 7, 2011 IP