Tell me more ×
WordPress Answers 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

2 Answers

up vote 2 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

I would add change the .htaccess file in fdsdegrss to this.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.fsdegrees\.com$ [OR]
RewriteCond %{HTTP_HOST} ^fsdegrees\.com
RewriteRule ^(.*) http://56degrees.co.uk/$1 [P]

Which should redirect all content from the old site to the same page on the new site. Once this is working you can delete the WordPress install on the old site.

share|improve this answer
BandonRandon thanks for your answer but it still not working I don't have an idea why because there is only one domain assign to my wordpress site as base domain which is 56degrees.co.uk and the other one is only pointing to that folder. Very strange – jmysona Dec 28 '11 at 23:27
I would have to see the htaccess files to know more. You are sayign you only have ONE database and ONE WordPress installed? – BandonRandon Dec 29 '11 at 7:27

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.