Moz Q&A is closed.
After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.
302 or 301 redirect to https ?
- 
					
					
					
					
 I am redirecting whole site to https. Is there a difference between 302 or 301 redirect for seo? Site never been indexed. Planning to do that with .htaccess command RewriteCond %{HTTPS} !=on 
 RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]There are plenty of ways http://www.askapache.com/htaccess/ssl-example-usage-in-htaccess.html Which way would be the best? Thanks is advance 
- 
					
					
					
					
 Thanks, Yes the site from the beginning will be https. We do have a good server, site speed according to google speed tool is 93. Sha, added [R=301,L] and now it's 301. 
- 
					
					
					
					
 HTTPS based sites normally add a little stress to the server for handling requests, make sure you are hosted on a good performance web host for users & search engines to access content fast. If you're making HTTPS as the default version and if bots take time to crawl your website, it might after your crawl rate (and possibly ranking) Just like how we see WWW and non-WWW, HTTP and HTTPS are looked as two different sites by search engines, I'd highly suggest you to go with 301 (permanent) re-direct from the start to save link juice. Keep your SSL certifications valid. If you don't intend to do 301 from start, check your logs often to see if you get any links to HTTP version (as most often people try to link here) and request webmasters to update the link to HTTPS if you want to see your HTTPS version ranking in SERPs. My personal suggestion is to stick with one and doing 301 before you launch the site live. Cheers 
- 
					
					
					
					
 oops, Thanks for the pickup  
- 
					
					
					
					
 Hi Sha - I think you meant Serge not Woj  But yes, good pick up - I omitted that detail in my hasty reply 
- 
					
					
					
					
 Hi Serge, The reason your redirect is creating a 302 is that it is an unspecified Redirect. Any redirect that is unspecified will by default be seen as a 302 (Temporary) To create a 301, you need to specify like this [R=301,L]Hope that helps, Sha 
- 
					
					
					
					
 301 - try this (in it's simplest form): RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.yoursite.com/$1 [R,L]
- 
					
					
					
					
 Thanks, I understand 301 and 302. This command creates 302. I see a lot of website in serp having 302 to https, but also I see a lot with 301. Which is right for Seo when in comes to https? 
- 
					
					
					
					
 301 = permanent redirection 302 = temporary redirection If the change is permanent then 301 The htaccess rewrite looks fine  
Browse Questions
Explore more categories
- 
		
		Moz ToolsChat with the community about the Moz tools. 
- 
		
		SEO TacticsDiscuss the SEO process with fellow marketers 
- 
		
		CommunityDiscuss industry events, jobs, and news! 
- 
		
		Digital MarketingChat about tactics outside of SEO 
- 
		
		Research & TrendsDive into research and trends in the search industry. 
- 
		
		SupportConnect on product support and feature requests. 
Related Questions
- 
		
		
		
		
		
		Is 301 redirect the only way when using Vanity URLs?
 We have been using vanity urls for some of our pages. Mostly the pages that have a vanity URL have a long URL length. But now the problem is, the vanity URL is getting displayed on the search engine when the particular keyword related to the page is entered. I checked the google search console, the vanity URL is indexed and the original URL remains unindexed. What should I do? Is adding 301 redirect to the vanity URLs are solution? Since some of vanity URLs are not redirecting to the original. Some of the original pages are not getting traffic. Also, can using canonical tag help? Technical SEO | | tejasbansode0
- 
		
		
		
		
		
		Delete old blog posts after 301 redirects to new pages?
 Hi Moz Community, I've recently created several new pages on my site using much of the same copy from blog posts on the same topics (we did this for design flexibility and a few other reasons). The blogs and pages aren't exactly identical, as the new pages have much more content, but I don't think there's a point to having both and I don't want to have duplicate content, so we've used 301 redirects from the old blog posts to the new pages of the same topic. My question is: can I go ahead and delete the old blog posts? (Or would there be any reasons I shouldn't delete them?) I'm guessing with the 301 redirects, all will be well in the world and I can just delete the old posts, but I wanted to triple check to make sure. Thanks so much for your feedback, I really appreciate it! Technical SEO | | TaraLP1
- 
		
		
		
		
		
		Meta descriptions and h1 tags during a 301 redirect
 My employer is shifting to a new domain and i am in the midst of doing URL mapping. I realize that many of the meta descriptions and H1 tags are different on the new pages - is this a problem ? Thank you. Technical SEO | | ptapley0
- 
		
		
		
		
		
		Best & easiest way to 301 redirect on IIS
 Hi all, What is the best and easiest way to 301 redirect URLs on IIS server? I got access to the FTP and WordPress back office, but no access to the server admin. Is there an easy way to create 301 redirect without having to always annoy the tech in charge of the server? Thanks! Technical SEO | | 2MSens0
- 
		
		
		
		
		
		Increase 404 errors or 301 redirects?
 Hi all, I'm working on an e-commerce site that sells products that may only be available for a certain period of time. Eg. A product may only be selling for 1 year and then be permanently out of stock. When a product goes out of stock, the page is removed from the site regardless of any links it may have gotten over time. I am trying to figure out the best way to handle these permanently out of stock pages. At the moment, the site is set up to return a 404 page for each of these products. There are currently 600 (and increasing) instances of this appearing on Google Webmasters. I have read that too many 404 errors may have a negative impact on your site, and so thought I might 301 redirect these URLs to a more appropriate page. However I've also read that too many 301 redirects may have a negative impact on your site. I foresee this to be an issue several years down the road when the site has thousands of expired products which will result in thousands of 404 errors or 301 redirects depending on which route I take. Which would be the better route? Is there a better solution? Technical SEO | | Oxfordcomma0
- 
		
		
		
		
		
		Changing title tags, do we need 301 redirects
 I found many duplicate title tags and I'm in the process of changing it Do I need 301 redirects in place when I switch it? I am only changing the title tag. Also, we are switching over to a new site very soon, I am worried that we might be using too many 301 redirect "hops" because we are doing a lot of optimization as well. (video from matt cutts describing 301 redirects and hops: http://www.youtube.com/watch?v=r1lVPrYoBkA. Does anyone have any experience in doing too many redirect hops that it affected your rankings? Any good ideas to avoid this? Technical SEO | | EcomLkwd0
- 
		
		
		
		
		
		Simple 301 redirect a subfolder to another subfolder
 Hi, I have a number of sub-folders that I have to move, each of which contains a number of files. subfolder A has files a, b & c subfolder B has files d, e & f Technical SEO | | aactive
 subfolder C has files g, h & i A, B & C folders need to be X, Y & Z Will the following work? RewriteRule ^subfolder-A/* http://www.domain.com/subfolder-X/ [R=301,L]
 RewriteRule ^subfolder-B/* http://www.domain.com/subfolder-Y/ [R=301,L]
 RewriteRule ^subfolder-C/* http://www.domain.com/subfolder-Z/ [R=301,L] will this result in visitors to http://www.domain.com/subfolder-B/f.html being redirected to http://www.domain.com/subfolder-Y/f.html? All on the same domain. in reality we are talking hundreds of sub folders and thousands of files so we don't want to have to reference every file individually in the htaccess. Thanks0
- 
		
		
		
		
		
		Is it worth setting up 301 redirects from old products to new products?
 This year we are using a new supplier and they have provided us a product database of approx. 5k products. About 80% of these products were in our existing database but once we have installed the new database all the URLs will have changed. There is no quick way to match the old products with the new products so we would have to manually match all 5k products if we were were to setup 301 rules for the old products pointing to the new products. Of course this would take a lot of time. So the options are: 1. Is it worth putting in this effort to make the 301 rules? 2. Or are we okay just to delete the old product pages, let the SE see the 404 and just wait for it to index the new pages? 3. Or, as a compromise, should we 301 the old product page to the new category page as this is a lot quicker for us do do than redirecting to the new product page? Technical SEO | | indigoclothing0
 
			
		 
			
		 
			
		 
			
		 
					
				 
					
				 
					
				 
					
				 
					
				 
					
				 
					
				