Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|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
add comment

1 Answer 1

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.

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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