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

So -- I've used mod rewrite a few thousand times to do things like changing url.tld/show/season/1 to load video.php?show=someshow&season=1.

However -- Now i need to do the opposite, show a temporary HTML page instead of serving PHP on those pages.

I've tried doing a rewrite cond including the ?, but it never seems to work.

RewriteRule ^/seasons/\?sid=1 migrating.html

EDIT I need to make sure the only page effected is the SID=1, not any of the other possible season ID's

Any ideas?

share|improve this question
up vote 2 down vote accepted

Took a bit of work to find, but

RewriteCond %{QUERY_STRING} sid=1$
RewriteRule ^.*$ /migrating.html

Did the trick.

share|improve this answer
This will work until someone asks for season 10 (sid=10). If sid= is always at the end, add a $ after it to mark it as the end of line. Otherwise, you might have to do this twice, once with sid=1$ and once sid=1&. I think sid=1($|&) should work. – DerfK Jun 13 '11 at 18:21
Yea, Already discovered that. :p Found the error :) – GruffTech Jun 13 '11 at 18: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.