Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-08-2008, 11:03 AM   PM User | #1
mr_ego
Regular Coder

 
Join Date: Jun 2002
Location: Brisbane, Australia
Posts: 181
Thanks: 1
Thanked 0 Times in 0 Posts
mr_ego is an unknown quantity at this point
htaccess confusion

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?
__________________
-mR_eGo
_______________________
Programming since
3 years old.
mr_ego is offline   Reply With Quote
Old 11-08-2008, 11:48 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
How about changing your logic like,
Code:
If the request is like /language/.*
 then redirect to the required file.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:18 AM.


Advertisement
Log in to turn off these ads.