Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I need to rewrite a specific wordpress url to a 404 error:

?page_id=15 => 404

How can I match the query string? Apparently Apache doesn't feed that to the rewrite mod...

share|improve this question
    
mod_rewrite should be able to handle this OK. –  w3d Nov 4 '12 at 14:19

1 Answer 1

up vote 1 down vote accepted

Using mod_rewrite, you can match a query string using this:

RewriteCond %{QUERY_STRING} page_id=15
RewriteRule .* - [R=404]
share|improve this answer
    
Thank you very much! :-) –  Fernando Nov 5 '12 at 22:36

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.