Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

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

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new 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? –  austin Aug 17 '12 at 12:56
add comment

1 Answer

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
add comment

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