Webmasters Stack Exchange is a question and answer site for pro webmasters. 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

I want to do permanent redirect using htaccess. For eg :- I want to redirect /modules/pages/?pageid=7 to http://www.xxx.com/aaa/.

This is what i have done Redirect permanent /modules/pages/?pageid=7 http://www.xxx.com/aaa/ but it gives me 404 error.

share|improve this question

migrated from stackoverflow.com Jan 8 '12 at 17:15

This question came from our site for professional and enthusiast programmers.

httpd.apache.org/docs/current/mod/mod_rewrite.html – Ruslanas Balčiūnas Jan 7 '12 at 15:00
up vote 2 down vote accepted

Try in you .htaccess, placing this above your wordpress rules (just under RewriteEngine On:

RewriteCond %{QUERY_STRING} ^pageid=7$
RewriteRule ^modules/pages/$ http://www.xxx.com/aaa/ [R=301,L]

Mod_alias's Redirect won't match against query strings.

share|improve this answer

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.