Page 1 of 1

Same RewriteRule doesnot work after change in configuration

Posted: Sun May 04, 2008 1:34 am
by devendra-m
I have following RewriteRule which was working fine before change in the server configuration. But now it doesnot work as expected.When I give directory path in url it redirects to error.php. It used to redirects to index.php before.

Code: Select all

 
RewriteEngine On
RewriteRule ^(.*)\.(.*)$     $1.$2
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$     $1.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$       error.php  

Re: Same RewriteRule doesnot work after change in configuration

Posted: Sun May 04, 2008 12:38 pm
by Christopher
What are those rules supposed to do? That looks strange. I think you have too many rules and can simplify.

Re: Same RewriteRule doesnot work after change in configuration

Posted: Sun May 04, 2008 11:31 pm
by devendra-m
1. It checks whether specified file exists or not
2. if it does not find the file it will concatenate .php with the file name (for those with a filename which have no extension or with other extension than php)
3. if it does not find the php file it will check whether given url is directory or not
4. if url is neither existing directory nor existing file, then it will redirect it to error.php