Forum Moderators: phranque

Message Too Old, No Replies

changed a directory to .php but have a problem

         

esllou

12:47 pm on Sep 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just changed a whole directory to .php from .shtml

I would like to redirect #*$!.shtml to #*$!.php so I put this in my .htaccess

RedirectMatch permanent (.*)\.shtml$ http://www.example.com$1.php

which is only in my changed folder. The problem is I want my home page to be example.com/folder/ and instead it keeps redirecting to example.com/folder/index.php

In my root folder for about 3 years, I've had a permanent redirect from .html to .shtml. Is this causing the problem?

Basically, I'd like to know a way of redirecting every page to its .php equivalent BUT have index.php go to /

jdMorgan

1:26 pm on Sep 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You'll need to use mod_rewrite, so that you can test for and exclude index page requests from being redirected by using RewriteCond.

Jim