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
-
cross canonicalization with redirect
I'm working with a website that has turned one of its pages into its own website within the main website - mostly for the ease of customers, making it simpler to access that page using www.page.com rather than www.mainsite.com/about/page.
Technical SEO | | Shrine.SEO.Gal
As a result, there are two urls for that page (the ones just mentioned), both pointing to the exact same page, but with different urls. Now, they have made it so www.mainsite.com/about/page permanently redirects to www.page.com. which I thought was a good call. However, what do I do about canonicalization? Is it good to point the canonicalization of www.page.com to www.mainsite.com/about/page so that the rankings and link equity are maintained in the main website? Or would the fact that the www.mainsite.com/about/page redirects to www.page.com mess that up? I hope this makes sense!0 -
Mobile website indexing
Hi we have a mobile version of our website at mobile.gardening-services-edinburgh.com its been live for 5, maybe 6 months, it has its own mobile-sitemap.xml have tried submitting this sitemap to google and for some reason it does not index these pages any ideas, most welcome
Technical SEO | | McSEO0 -
URL redirect question
Hi all, Just wondering whether anybody has experience of CMSs that do a double redirect and what affect that has on rankings. here's the example /page.htm is 301 redirected to /page.html which is 301 redirected to /page As Google has stated that 301 redirects pass on benefits to the new page, would a double redirect do the same? Looking forward to hearing your views.
Technical SEO | | A_Q0 -
301 Redirect Help
How would you 301 redirect and entire folder to a specific file within the same domain? Scenario www.domain.com/folder to www.domain.com/file.html Thanks for your Input...
Technical SEO | | dhidalgo11 -
Will links to www and none www result in penalty?
Hello all, Normally i redirect my www to none www to avoid the potential of duplicate content and as its typically something that is done in SEO. I don't have access to the site of the company I am working for at the moment as everything related to the sites code goes through the web developer. At the moment the site lives at www and none www and one does not redirect to the other. I have been building links (organically as we engage on a few forums and blogs) to the www as that is how it is linked internally already and how links from the job boards we post on link. We do however have some natural none www links and my concern is that since the site isn't redirected that it is being penalised or could become penalised because of this. I imagine that it isn't a serious penalty if one at all but I would rather know so I can try and get it sorted as fast as possible. Thanks.
Technical SEO | | LukeHutchinson0 -
Links to Website Author
I'm a website developer, and in the past I have usually added a tiny backlink to the footer of my clients' websites like this: Website Design by MyCompanyName I understand that Google sees this as a low-quality backlink. However, I was wondering if such links can hurt my rankings. Does Penguin sees these links as spam? If so, should I add a rel="nofollow" to the links? Is there anything else I should change? I do not want to remove these links completely because they are good for marketing my business. I just want to minimize any negative SEO impact of the links. I appreciate your input. Thanks.
Technical SEO | | SiteWizard_LLC0 -
Setup 301 Redirects
I have been asked to transfer a clients old domain over to a new domain with a new site. All of the inbound links basically go to the homepage, and the few links that dont go to the homepage on the old site, might as well be redirected to the homepage on the new site. I'm wondering is there a "catch all" sort of redirect such as www.oldsite.com/* redirects to newsite.com. So any redirects we havent set up will automatically go to the new site homepage? And secondly, whats the easiest way to the redirects up? Can I just add it as a parked domain or addon domain in cpanel, and do the redirects in there? Or does it needs its own hosting for the old domain with its own htaccess file? Any help appreciated! 🙂
Technical SEO | | timscullin0 -
301s and Link Juice
So I know that a 301 will pass the majority of link juice to the new site, but if that 301 is taken away what happens?
Technical SEO | | kylesuss0