2

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...

  • mod_rewrite should be able to handle this OK. – MrWhite Nov 4 '12 at 14:19
1

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

RewriteCond %{QUERY_STRING} page_id=15
RewriteRule .* - [R=404]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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