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

I've moved my Wordpress from one domain to another, and I want the use .htaccess 301 redirects to redirect posts on the old domain to posts on the new domain.

My webhost suggested I try the following:

 Options +FollowSymlinks
 RewriteEngine On
 RewriteCond %{HTTP_HOST} ^(www\.)?steve\.doig\.com\.au/wordpress/$ [NC]
 RewriteRule ^(.*)$$1 [R=301,L]

This works only for the /wordpress folder, but not for any of the category pages or posts.

What is wrong here?

share|improve this question
up vote 2 down vote accepted

This line RewriteCond %{HTTP_HOST} ^(www\.)?steve\.doig\.com\.au/wordpress/$ [NC] is setting a condition on the rewrite process. Basically it only works on urls finished with /wordpress/. Try commenting that line (if you only have the Wordpress installation running, it will redirect everything).

share|improve this answer
Brilliant, that fixed it. – Steve Mar 7 '11 at 3:16

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.