0

Possible Duplicate:
redirect *.php to *.html

My URL is index-main.html and it is redirecting to index-main.php, only index-main.html is showing on the address bar. My .htaccess file is:

<IfModule mod_rewrite.c>
   Options +FollowSymLinks
   RewriteEngine on
   RewriteRule index-main.html index-main.php
</IfModule>

But if I am calling index-main.php on the address bar, it is also working (the page displays), but the URL is not changing.

I want my URL to be index-main.html on the address bar. If i type index-main.php in the address bar, it should redirect to index-main.html, the URL should change.

1
  • it doesn't really matter what you call it... it is displaying the same thing. is there a reason why you have the rewriterule on?
    – au_stan
    Aug 17, 2012 at 12:56

1 Answer 1

-1

You can rename your file:

mv index-main.php index-main.html 

Then add to your .htaccess

AddHandler application/x-httpd-php .html

And should work without rewrite_mod

2
  • this is a horrible way to do it. You will run every html page through php
    – Mike
    Aug 17, 2012 at 13:29
  • first: but only in this vhost second: is there any other html page if he uses php?
    – klocek
    Aug 17, 2012 at 13:37

Not the answer you're looking for? Browse other questions tagged .