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
-
Redirecting issue
Please I have a domain name miaroseworld.com I redirected (301 redirect) it to one of my domain names and I am having issues with the website so I decided to redirect to to my new site but moz is still showing redirecty to the previous websites
Technical SEO | | UniversalBlog
Even when I change the redirect on search console it still showing redirecting to the previous site.0 -
I want to set different price type for India and USA through schema. for eaxmple website is abc.com & there is no cookie/country level redirection.
I am currently working on a website (Ed tech) that is doing business in India as well as USA. The courses are same. Content being served is also same. There is no cookie level redirection. The only difference is in the price range and price type. In schema we have set price type as $. We want to set different price type for India and USA through schema. How can we do this? For example given below website ranks for India & USA with the same domain name but prince range that we can setup either in INR or USA
Technical SEO | | DJ_James0 -
301 Redirects
Looking for the best way to do the following. Business has changed its name, and has also become a corporate store. The old domain name is now no longer needed as a website page has been created inside the main corporate site. Obviously i dont want to loose all the traffic that we had and want to redirect them but there is a problem, that im unable to redirect the old domain to the new one due to office 365 installed on the hosting platform, and the old emails will need to run for another 6 months. I can remove the old site and put a landing page up, but i still need to redirect all the pages to the new site, and there is approx 50+ of them. My main question is i currently have atleast 50+ redirects already in there due to seo changes over the years, some would go back atleast 5 years, whats a safe amount of time that i can remove the older redirects And am i going about this the right way so i dont loose all the hard work on rankings etc
Technical SEO | | Dunjoko0 -
Redirect Error
Hello, I was sent a report from a colleague containing redirect errors: The link to "http://www.xxxx.com/old-page/" has resulted in HTTP redirection to "http://www.xxxx.com/new-page".Search engines can only pass page rankings and other relevant data through a single redirection hop. Using unnecessary redirects can have a negative impact on page ranking. Our site is host on Microsoft Servers (IIS). I'm not sure what is causing these errors. Would it be the way the redirect was implemented.
Technical SEO | | 3mobileIreland0 -
Website Pop up
I want to install a pop up on my site for collecting email addresses. I use nopcommerce as my platform. I was quoted a price to custom develop it but thought there might just be a simple plugin. I can find them for wordpress but that is all. Does anybody have experience with this?
Technical SEO | | katazoom0 -
Magento Redirect Loop
On my clients site I changed the URL structure for products. First they had a trailing slash: http://www.wellamy.com/market/food/oklahoma-relief-effort/healthy-snacks/caramel-apple-chewy-snack-bars/ I changed it to end in .html http://www.wellamy.com/market/food/oklahoma-relief-effort/healthy-snacks/caramel-apple-chewy-snack-bars.html Now rather than redirecting properly, it causes a redirect loop. Any idea how I can fix this?
Technical SEO | | Imajery0 -
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 -
Https redirect
Hi there, a client of mine is asking me if Google would penalize to redirect from all the http urls to https (they want to change the security protocol). I assume it is going to work as a classic 301, right? so they might lose some authority in they way, but I am not 100% sure. Can anyone confirm this? does anyone has a similar experience? thanks a lot!
Technical SEO | | elisainteractive0