Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I recently changed the base domain on my Wordpress website from http://www.fsdegrees.com to http://www.56degrees.co.uk. I would like to create various of 301 from old domain to new one, but for some reason I can still access pages using the old domain www.fsdegrees.com/blog I though it should come back with 404. I'm just afraid that Google will penalize me for double content.

Any idea why that's happening. Many thanks,

share|improve this question

1 Answer 1

up vote 3 down vote accepted

I just did this on a client site. I set up my rules like this:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.*)fsdegrees.com [NC]
RewriteRule ^(.*)$ http://www.56degrees.co.uk/$1 [R=301,L]

The first rule checks the incoming domain and verifies that it is the old domain. The second sends a 301 redirect and visitors are sent to the corresponding page on the new domain, assuming that the URL structure has remained the same. You do not want to just serve up a 404 page as you will lose all of the indexed links in search engines. 301 redirects will tell search engines where the new replacement pages are. (You'll get 404 ONLY if the new pages cannot be found.)

And these rules will work whether both domains point to the same folder or if they point to different folders. In the case that they point to different folders, you will have to add these rules to an .htaccess file in the old domain folder.

share|improve this answer
    
Perfect Velet Blues it did the trick, do i need to write that for every single page i.e. www.fsdegrees.com/blog www.fsdegrees.com/about-us etc. The page structure is exactly the same for the new domain so www.fsdegrees.com/blog = www.56degrees.co.uk/blog etc. –  jmysona Jan 2 '12 at 11:54
    
No, these rules should work for ALL pages. If it isn't working, make sure you don't have any conflicting rules in your .htaccess file. These rules should be FIRST. –  Velvet Blues Jan 2 '12 at 13:17
    
Perfect that was the problem, it works once i moved it to the top of the file. Thanks a lot!!! –  jmysona Jan 2 '12 at 13:40
    
It works! Thank you for that! –  MikhailSP Jun 15 '13 at 17:44

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.