How to setup redirects
-
Hi Guys,
If you're doing an SEO migration and have multiple versions of the same page example:
Version 1: http://naturesway.com.au/superfood/super-maca-powder
Version 2: https://naturesway.com.au/superfood/super-maca-powder
Version 3: https://www.naturesway.com.au/superfood/super-maca-powder
And you want to redirect them to a new URL (new site):
https://www.naturesway.com.au/nw-superfoods-maca-powder-100g
How would you ensure you redirect all the different versions of URL (versions 1,2,3) to the new URL on the new site?
Cheers.
-
I think it would be something like:
<code>RewriteEngine On RewriteCond %{HTTPS} off RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] This would go in your .htaccess file, you should be sure to edit the file via FTP so that if you break it, you can restore the old version and fix the site in seconds (keep a backup of the old .htaccess file) If you are on a windows-based server you'd need the equivalent rule for your web.config file as IIS doesn't use .htaccess For most sites, you have a .htaccess file and it sits in the root of your FTP (the same place that your primary index.php file lives, where robots.txt and sitemap.xml also usually reside)</code>
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
-
Redirect Chain Advice
Hi, i hope you can help. My site crawl is showing that I have a redirect chain on my home page. Basically it shows I am going from : http: > https: > https://www. I need everything to go from http:// and http://www directly to https://www. without the chain. Below is a copy of the htaccess, can anyone see if there is an error in there that could be causing it. RewriteEngine On
Intermediate & Advanced SEO | | DaleZon
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] BEGIN WordPress <ifmodule mod_rewrite.c="">RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]</ifmodule> END WordPress In addition, i have seen that they have a plugin called SSL insecure content fixer installed. It is showing this under its status: Array ( [HTTPS] => on [PHPHANDLER] => /usr/local/php70/bin/php [HTTP_X_REAL_IP] => 109.158.20.158 [HTTP_X_FORWARDED_PROTO] => https ) I think possibly this might have something to do with the issue, any thoughts are appreciated Thanks0 -
How Critical to Address Redirect Chains?
We have about 100 redirect chains and were not sure of the impact they are having on our SEO. One SEO expert wants to charge around $800 to clean these up for us. Any thoughts on how serious of an issue this is and how important it is to address?
Intermediate & Advanced SEO | | roundtable10 -
Ecommerce catalog update: 301 redirects?
Hello mozers, We run an ecommerce store and are planning a massive catalog update this month. Essentially, 100% of our product listings will be deleted, and an all new catalog will be uploaded. The new catalog contains mostly new products, however there are some products that already existing in the old catalog as well. The new catalog has a bunch of improvements to the product pages, included optimized meta titles and descriptions, multiple language, optimized URLs and more. My question is the following: When we delete the existing catalog, all indexed URLs will return 404 errors. Setting up 301 redirects from old to new products (for products which existing previously) is not feasible given the number of products. Also, many products are simply being remove entirely. So should we go ahead and delete all products, upload the new catalog, update the sitemap, resubmit it for crawling, and live with a bunch of 404 errors until these URLs get dropped from Google? The alternative I see is setting 301 redirects to the home page, but I am not sure this would be correct use of 301 redirects. Thanks for your input.
Intermediate & Advanced SEO | | yacpro130 -
Multilingual Site and 301 redirection
Hey there awesome people of Moz I have this site that has many languages in it. The main language is English and my developer did the following www.example.com ( is the main site ) which redirects with a 301 to www.example.com/en if your geo location is supported by our languages then you will automatically be redirected to whatever language you have in your country but does the first language with is english have to 301 redirect to www.example.com/en ? I thought that the right way is to just leave /en at the root file. Thanks in advance
Intermediate & Advanced SEO | | Angelos_Savvaidis0 -
Redirecting non www site
Hello Ladies and Gentlemen. I 100% agree with the redirecting of the non www domain name. After all we see so many times, especially in MOZ how the two different domains contain different links, different DA and of course different PA. So I have posed the question to our IT company, "How would we go about redirecting our non www domain to the www version?", "Where would we do that?", " we cant do the redirect on our webserver because the website is listed as an IP address, not a domain name, so would we do the redirect somewhere at GoDaddy?" who is currently maintain our DNS record So here is the response from IT: " I would setup a CNAME record in DNS (GoDaddy), such that no matter if you go to the bare domain, or the www, you end up in the same place. As for SEO, having a 301 redirect for your bare domain isn't necessary, because both the bare domain and the www are the same domain. 301 is a redirect for "permanently moved" and is common when you change domain names. Using the bare domain or the www are NOT DIFFERENT DOMAINS, so the 301 would not be accurate, and you'd be telling engines you've moved, when you haven't - which may negatively impact your rank. It sounds to me that IT is NOT recommending the redirect. How can this be? Or are we talking about two different things? Will the redirect cause the melt down as the IT company suggests? Or do they nut understand SEO?
Intermediate & Advanced SEO | | Davenport-Tractor0 -
How can i redirect my site to other domain ?
I have been running an eCommerce site since 2008 and have a PR3 with mostly have an authority link from reputed sites, how can I transfer my existing eCommerce site to the new domain so in the new domain i get SEO value from the old domain. Please advice.
Intermediate & Advanced SEO | | chandubaba0 -
301 redirect
Hi there, I have some good links pointing to one of my web pages at the moment, however we are just about to launch a new design with new URL structure and I am clear that I need to do a 301 redirect on the URL to the new URL. However, do I keep the old URL live forever? or can I remove it after a while? Kind Regards
Intermediate & Advanced SEO | | Paul780 -
Redirect gateway domain to main domain?
We have following scenario: Our main website - www.esedirect.co.uk which gets a 1800 visits a day with around half of those from organic search. It's been around since 2004. Our original website - www.ese.co.uk which gets around 30 visits a day and really is nothing more than a doorway page with links to the above site and couple of other sites that belong to the same company. This is an old domain that's had content since 1997 and has good domain authority with some good links. We are considering doing a 301 redirect from www.ese.co.co.uk to www.esedirect.co.uk to redirect the link juice. I welcome opinions to any possible negative effects this could give and how beneficial doing this will be. Thanks, Lee
Intermediate & Advanced SEO | | ese0