Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

How can I redirect website using 301 Redirect on wordpress?

My client has already got a wordpress website which is called http://www.soundproofing-london.co.uk/, but he wanted to redirect using 301 Redirect on that wordpress site to the new one that has been created - http://www.transformsoundukltd.co.uk.

the reason of doing this is for SEO purposes. He/She doesn't want to lose his ranking on google site.

3 Answers

Lucas Santos
Lucas Santos
19,315 Points

I'v never had to do this but if I were you try going to the header.php file of the Wordpress template and and use this code:

<?php 
header("HTTP/1.1 301 Moved Permanently"); 
header("Location: http://www.transformsoundukltd.co.uk"); 
?>

will that affects seo purposes u know?

Lucas Santos
Lucas Santos
19,315 Points

Not really sure if it will not generate new traffic on the old site and just redirect that traffic to the new site, but wouldn't you want the new site to build traffic instead of the old one? My would assume that the traffic only directs to one website and that is the redirected on (new one). Not 100% sure on everything but just look it up, although it does redirect the page permanently.

Jonathan Söder
Jonathan Söder
7,428 Points

If i remember correctly you can use:

.htaccess (found in root) and add this line:

Redirect 301 / http://www.new-site.com/

Neither should affect SEO that much, both lucas' and mine are 301's. According to Moz "90-99% link juice passes on to the new site. ". (I'm not sure how they ended up with those numbers)

http://moz.com/learn/seo/redirection