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.

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.

myshows.com/seasons/?sid=1

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

1 Answer 1

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

 
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.