In my .htaccess file, I have the following line:

RewriteRule ^f/(.*)$ /blah.php?g=$1

I'm trying to make a url such as

example.com/f/three

to be interpreted as

example.com/blah.php?g=three.

However, visiting a url like the former results in a "maximum internal redirects" error. What am I doing wrong?

link|improve this question
What happens if you go directly to /blah.php?g=three ? – Michael Graff Nov 15 '09 at 22:17
1  
it works as it should, with no redirects. – mindeavor. Nov 15 '09 at 22:59
feedback

1 Answer

up vote 2 down vote accepted

I figured out the problem. There was an additional sneaky .htaccess file inside a folder with the same name as f, which was causing all the redirects. Here is what ended up being the correct line:

RewriteRule ^f/(.*)$ /blah.php?g=$1

Since this is in a .htaccess file, the slash before the f should be absent.

link|improve this answer
Ahh, I'm glad you found the answer, and answered your own question. :) – Michael Graff Nov 15 '09 at 23:31
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.