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
-
302 Redirect Question
After running a site crawl. I found two 302 redirects. The two redirects go from: site.com to www.site.com & site.com/products to www.site.com/products How do I fix the 302 redirect and change it to a 301 redirect? I have no clue where to start. Thanks.
Technical SEO | | Ryan_1320 -
How long before I can use a redirected domain without taking back link juice?
We recently moved our website to a new domain that better matched our brand. I want to use the old domain at some point for another aspect of our business. How long after we do the domain redirect will it be safe to use the old domain again--without affecting the seo of the new domain? Thanks! Harriet
Technical SEO | | zharriet0 -
How should I set up a domain redirect
A client has 2 domains that he wants to use for the same site. At the moment one domain is just an abbreviation of the main domain (not sure why) as follows: www.mygreatpropertycompany.com
Technical SEO | | davidmaxwell
www.mgpc.com (just redirects to the above) He is complaining that when he searches for 'mpc' there are no results (at all) so I'm wondering what the best approach is.There is currently nothing on the main domain that refers to 'mgpc' in it's abbreviated sense - the only place it's being used is the company's email addresses (info@mgpc.com). The redirect is simply a html file in the root of www.mgpc.com as follows: Is there anything I can do to help him out? (this is one of those 'doing a friend a favour' tasks!) Thanks!0 -
Slow website
Hi I have just migrated from a custom written php/mysql site to a site using wordpress and woocommerce. I couldnt believe the drop in speed . I am using a few plugins for wordpress - contact forms / social sharing. and I have a few woocommerce plugins for taking payment etc. I am hosting images css's and js's on W3 Total Cache and MAXCDN hoping to speed the site up but tools at http://tools.pingdom.com/fpt sometimes show that the time between browser request and reply can be between 1 and 15 secs. I have searched all day looking for a post I read about two months ago with a tool that seems to look at server responce and redirect processing etc hoping it would help but cant find it. If anyone knows what I am talking about I would appreciate them posting a link The site is http://www.synergy-health.co.uk and an example of an inner page is http://www.synergy-health.co.uk/home/shop/alacer-emergen-c-1000-mg-vitamin-c-acai-berry-30-packets-8-4-g-each/ Any suggestions please? Perhaps I have w3total cache set wrong? Also, as the has been tanked and is in freefal iin google ranking since January would this be a good time to change the structure of Url from home/shop/product to domain.name/brand/product? Thanks in advance !
Technical SEO | | StephenCallaghan0 -
Www vs no-www duplicate fix?
Hi all, I have more or less published two versions of our site. One on "www" and one without. And of course we uncovered it during our SEO crawl as "duplicate" content/titles. My guess (hope) is this is something that can be easily fixed on the server side, but I don't have a lot of knowledge around it. Does anyone know?
Technical SEO | | Becky_Converge0 -
I have 2 websites with the same content
Hello everyone, this is my first post here on SEOmoz and I have a questions that I cannot seem to figure out. So here is my scenario: I have 2 websites that are identical. The only difference between the 2 websites is the domain name. This was done a while back for marketing purposes, however, I am no longer needing my 2nd website. What is the best way to get rid of this second website? I still have about 1 paying customer a day convert on this 2nd website and I do not want to loose them, however, I know that I am getting penalized by the search engines because of this duplicate content. Please let me know the best way of going about this. PS: I have read about 301 redirects, canonicalizing URLs, and other methods but do not know which one to choose. Any help is greatly appreciated!
Technical SEO | | threebiz0 -
Redirect blogspot blog ?
Hi We have an ecom site selling childrens clothing. We startet up with a blogspot blog due to the lack of that option from our provider. I have a few links in to the blogspot blog and realized today that the PA is 39 - the PA of homepage of ecom site is 40. Ive lately been using the ..../blog on my ecom site. The functionality so far of it is so bad that i am considering using the blogspot blog again. How can i best utilize the strength of our blog at blogspot. Just keep posting w anchor text to relevant pages our main site? Is redirecting a possibility at all ? Dan Lærum
Technical SEO | | danlae0 -
Do search engines treat 307 redirects differently from 302 redirects?
We will need to send our users to an alternate version of our homepage for a few hours for a certain event. The SEO task at hand is to minimize the chance of the special homepage getting crawled and cached in the search engines in place of our normal homepage. (This has happened in the past so the concern is not imaginary.) Among other options, 302 and 307 redirects are being discussed. IE, redirecting www.domain.com to www.domain.com/specialpage. Having used 302s and 301s in the past, I am well aware of how search engines treat them. A 302 effectively says "Hey, Google! Please get rid of the old content on www.domain.com and replace it with the content on /specialpage!" Which is exactly what we don't want. My question is: do the search engines handle 307s any differently? I am hearing that the 307 does NOT result in the content of the second page being cached with the first URL. But I don't see that in the definition below (from w3.org). Then again, why differentiate it from the 302? 307 Temporary Redirect The requested resource resides temporarily under a different URI. Since the redirection MAY be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field. The temporary URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s) , since many pre-HTTP/1.1 user agents do not understand the 307 status. Therefore, the note SHOULD contain the information necessary for a user to repeat the original request on the new URI. If the 307 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.
Technical SEO | | CarsProduction0