Same RewriteRule doesnot work after change in configuration

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
devendra-m
Forum Contributor
Posts: 111
Joined: Wed Sep 12, 2007 3:16 am

Same RewriteRule doesnot work after change in configuration

Post 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  
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Same RewriteRule doesnot work after change in configuration

Post by Christopher »

What are those rules supposed to do? That looks strange. I think you have too many rules and can simplify.
(#10850)
devendra-m
Forum Contributor
Posts: 111
Joined: Wed Sep 12, 2007 3:16 am

Re: Same RewriteRule doesnot work after change in configuration

Post 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
Post Reply