...

View Full Version : htaccess confusion



mr_ego
11-08-2008, 11:03 AM
hey everyone ...

in my .htaccess file, i have the following code:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>

which basically stipulates that if someone types the address:
http://www.example.com/language/en
it will redirect them to the following address:
http://www.example.com/index.php/language/en

This works great! But the problem is, if i have files in the directory which also use this type of methodology, they're not working. For example ...

If I type the following in:
http://www.example.com/test.php/language/en
It attempts to redirect me to the following (which I dont want it to redirect me at all):
http://www.example.com/index.php/test.php/language/en

Now, I have told htaccess (using the !-f and !-d operators) that if the file exists, do not redirect - however, it's not liking the rewriting that's occuring because the filename is not an "exact match".

The script has to be flexible to allow this ...

Does anyone have any suggestions?

abduraooft
11-08-2008, 11:48 AM
http://www.example.com/language/en How about changing your logic like,

If the request is like /language/.*
then redirect to the required file.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum