Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.

share|improve this question

marked as duplicate by Chris S Aug 17 '12 at 13:45

This question was marked as an exact duplicate of an existing question.

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 '12 at 12:56

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

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.