Need .htaccess rewrite help

Discussion in 'Apache' started by veolive, Jan 22, 2011.

  1. #1
    Want to Internal Redirect .php files to .html files

    - Redirects all files that end in .html to be served from filename .php so it looks like all pages are .html but really they are .php

    Right now using this code in .htaccess but it is not working...

    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /
    RewriteRule ^(.*)\.html$ $1.php [R=301,L]
     
    veolive, Jan 22, 2011 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    There is no need for R=301. It is an internal redirect. Make sure you have defined the correct RewriteBase. Where you have placed .htaccess file and which URL you are accessing?
     
    mwasif, Jan 22, 2011 IP