Right redirect to transfer juice www, no-www and website movement
-
Hi here is my problem, I have a website which works both with www. and without www; Now I want to optimize it and transfer it to another new domain along with the link juice of both the old domain with www and without www. I don't want to do it with multiple redirects but with just one clean redirect (I know that search engines don't like that, am I right?). What should I write in the .htaccess of the old domain and in the one of the new domain?
To summarize I want something like that:
www.oldsite.com/anyfile.html>301>www.newsite.com/anyfile.html
oldsite.com/anyfile.html>301>www.newsite.com/anyfile.html
newsite.com/anyfile.html>301?>www.newsite.com/anyfile.html
Thanks
-
Yes if you just want to redirect individual pages like that - you could have it so any requests on the domain www and none redirect to the new domain and then specific pages can point to specific pages - see below:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain.co.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.co.uk$
RewriteRule ^/?$ "http://www.newdomain.co.uk" [R=301,L]
RewriteRule ^page2.html$ "http://www.newdomain.com/page2.html" [R=301,L]
-
Ok thank you very much for the useful answer. I have one more question for you. What about if I want to redirect page by page?
Is something like this going to work?
RewriteEngine on RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com$
RewriteRule ^page1.html "http://www.newdomain.com/page1.html" [R=301,L]
RewriteRule ^page2.html "http://www.newdomain.com/page2.html" [R=301,L]
-
RewriteEngine on RewriteCond %{HTTP_HOST} ^olddomain.co.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.co.uk$
RewriteRule ^/?$ "http://www.newdomain.co.uk" [R=301,L]
Add this to your .htaccess file of your oldsite and it will redirect both www. and none www. to your new domain passing on link juice - sorry I wasn't specific before.
-
This is general information about the topic that I already know. What I need is the exact code to insert in my .htaccess to be sure that I am doing the best redirects for my specific case.
Thanks anyway Matt.
-
Hi Simone
I think this will help solve your problem -
http://www.seomoz.org/blog/url-rewrites-and-301-redirects-how-does-it-all-work
and how to actually do it -
http://www.webconfs.com/how-to-redirect-a-webpage.php/
You will only need to create the redirect in the old domains htaccess file so that all traffic to the old domain will go to the new one.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
www vs non-www
We have 2 variations of domains. www and non-www
Technical SEO | | aaaannieee
Both can be seen by users and have been linked to on press releases, but only the www one has data on Google Search Console.
In the case, what is the best practice for us?0 -
301 Redirects - Clearing out a 300 Page WordPress Website (HELP)
I'm working on a WordPress website that has around 300 pages (not posts, pages), many of which have very little content and / or content that is super outdated with zero relevancy. The site has been up and running for 10 years and ranks well overall, 1st in many instances for competitive keywords. The company holds yearly events and works with various other companies who exhibit at their events. In their very early years, they created pages on their website for each of these companies, some of which don't even exist anymore. If I had to delete all of the pages that are deprecated there would only be 10 pages of the site left (with blog posts counted separately). Would it be safe to remove these pages and set a 301 redirect to a semi-related page without hurting the website rankings? Any and all advice appreciated!!
Technical SEO | | enimmo19970 -
Redirect Question
We have a client that just did a redesign and development and the new design didn't really match their current structure. They said they didn't want to worry about matching site structure and never put any effort into SEO. Here is the situation: They had a blog located on a subdomain such as blog.domain.com - now there blog is located like domain.com/blog They want to create redirects for all the old the blog urls that used to be on the subdomain and not point to the domain.com/blog/post-name What is the best way of doing that - Through .htaccess?
Technical SEO | | Beardo0 -
My beta site (beta.website.com) has been inadvertently indexed. Its cached pages are taking traffic away from our real website (website.com). Should I just "NO INDEX" the entire beta site and if so, what's the best way to do this? Please advise.
My beta site (beta.website.com) has been inadvertently indexed. Its cached pages are taking traffic away from our real website (website.com). Should I just "NO INDEX" the entire beta site and if so, what's the best way to do this? Are there any other precautions I should be taking? Please advise.
Technical SEO | | BVREID0 -
Forms and link juice
On product listing page on e-commerce site We use POST forms as 'Add To Cart' buttons. Because of that We have dozens (~40-80) forms on any product listing page, and two questions regarding them: Does these forms affect link juice of other links on the page? Are there cases when forms are somehow counted by Google as links? Regards, Lucek
Technical SEO | | lucek0 -
Advises for redirects
I worked on a website since 2 years now (mainly link building). Now, I need to change the CMS and the hosting company of this website. In order to improve the SEO of this website, I decided to change the URL structure as well, see example here below: Actual situation: http://www.mywebsite.com
Technical SEO | | Tit
http://walla.mywebsite.com/
http://ortak.mywebsite.com/ http://www.mywebsite.com/de
http://walla.mywebsite.com/de
http://ortak.mywebsite.com/de http://www.mywebsite.com/es
http://walla.mywebsite.com/es
http://ortak.mywebsite.com/es Future situation: http://www.mywebsite.com
http://www.mywebsite.com/walla
http://www.mywebsite.com/ortak http://www.mywebsite.com/es
http://www.mywebsite.com/es/walla
http://www.mywebsite.com/es/ortak http://www.mywebsite.com/de
http://www.mywebsite.com/de/walla
http://www.mywebsite.com/de/ortak Since the hosting, the CMS and the URL’s will change, what you recommend me to do in order to keep a maximum of “link juice” to the pages!? How / Where to setup the 301 redirects?0 -
Is a 302 redirect the correct redirect from a root URL to a detail page?
Hi guys The widely followed SEO best practice is that 301 redirects should be used instead of 302 redirects when it is a permanent redirect that is required. Matt Cutts said last year that 302 redirects should "only" be used for temporary redirects. http://www.seomoz.org/blog/whiteboard-interview-googles-matt-cutts-on-redirects-trust-more For a site that I am looking at the SEO Moz Crawll Diagnostics tool lists as an issue that the URL / redirects to www.abc.com/Pages/default.aspx with a 302 redirect. On further searching I found that on a Google Support forum (http://www.google.com/support/forum/p/Webmasters/thread?tid=276539078ba67f48&hl=en) that a Google Employee had said "For what it's worth, a 302 redirect is the correct redirect from a root URL to a detail page (such as from "/" to "/sites/bursa/"). This is one of the few situations where a 302 redirect is preferred over a 301 redirect." Can anyone confirm if it is the case that "a 302 redirect is the correct redirect from a root URL to a detail page"? And if so why as I haven't found an explanation. If it is the correct best practice then should redirects of this nature be removed from displaying as issues in the SEO Moz Crawll Diagnostics tool Thanks for your help
Technical SEO | | CPU0