Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

I'm trying to make a url such as

to be interpreted as

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
it works as it should, with no redirects. – mindeavor. Nov 15 '09 at 22:59
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

Your Answer


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.