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
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
-
301 redirected all my pages to my new domain, now I have a problem with Google Search Console
Hi guys! I bought a new domain name and redirected all my URLs from the old domain to the new one. Everything worked perfectly but now I have a little problem. I want to use the option 'Address Change' in google search console. Step 1 Works (Select new website in the list) Step 2 Works (Confirm that the 301 are working) Step 3 Asks me to Verify the old domain (huh!?) in order to complete the request. Obviously that doesn't work because my 301s WORKS! So if I try to verify the old website by putting a google file in the root of my domain Google tries to access it and it automatically redirects to the new domain. I must be missing something lol help!
Technical SEO | | benoit_20180 -
301 Redirect with ASP (not .NET)
I'm looking to redirect non www to www and also .co.uk to .com. http://www.xxxxx.com is the intended target. http://xxxxx.com & http://www.xxxxx.co.uk & http://xxxxx.co.uk to redirect. I managed to do some of this but if I come through to a service page /services/cars.asp it redirects to the homepage. All I have so far is this code: <% If InStr(Request.ServerVariables("SERVER_NAME"),"www") = 0 ThenResponse.write "http://www." & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("URL") & "?" & Request.ServerVariables("QUERY_STRING")Response.EndEnd if %> What am I missing?
Technical SEO | | Hughescov0 -
302 to 301 redirect confirmation
Hi guys, Fairly sure of the answer from what I've read so far, but I just wanted to doublecheck I have it right. Page A gets a significant amount of referring, followed traffic, and also ranks in Google. Page A uses a 302 redirect to Page B (on a completely different domain), which means that 0% of Page A's link juice is being passed on to Page B. If I were to change the 302 redirect to a 301 redirect, then the link juice passed on to Page A from the followed, referring traffic will be (mostly) passed on to Page B. Is that correct? Cheers, Jez
Technical SEO | | jez0000 -
302 Redirect of Home Page - Lost Link Juice?
I've got a new client whose site is set up to redirect the home page to another URL, like www.example.com, redirecting to www.example.com/home/, using a 302 redirect. Am I correct in assuming that links pointing directly to www.example.com are not passing their full value because it is being redirected with a 302 rather than 301? (In a nutshell, I want to make sure this resource is still accurate: http://www.seomoz.org/learn-seo/redirection)
Technical SEO | | kpclaypool0 -
Where does Wordpress store the 301 redirects?
Hi, I've just created a campaign for my new wordpress blog and found 11 301 redirects which I was not aware of. It looks like wordpress has created them automatically. Does any one know how wordpress handles this issues or where are they stored so I can delete them? They are of no use for me. 9 of these redirects point to the same url with an added '/' and are in pages 1 is on a post. I've been changing the permalink and some urls several times and maybe one of these times the Wordpress has automatically created the 301 redirect. But why? I do not want to keep the old url. the last redirect is very strange it goes from http://www.mydomain.com/folder to http://www.mydomain.com where folder is the folder where I installed wordpress. But again, I want no one to type the url with the folder name or even know this folder exists. Any comment on this would be greatly appreciated. Thanks a lot, David
Technical SEO | | dballari0 -
301 Redirect "wildcard" question
I have been looking at the SEOmoz redirect guide for some advice but I can't seem to find the answer : http://www.seomoz.org/learn-seo/redirection I have lots of URLs from a previous version of a site that look like the following: sitename.com/-c-25.html?sort=2d&page=1 sitename.com/-c-25.html?sort=3a&page=1 etc etc. I want to write a redirect so whenever a URL with the terms "-c-25.html" is requested it redirects to a specified page, regardless of what comes after the question mark. These URLs were created by our previous ecommerce software. The 'c' is for category, and each page of the cateogry created a different URL. I want to do these so I can rediect all of these URLs to the appropraite new cateogry page in a single redirect. Thanks for any help.
Technical SEO | | craigycraig0 -
Too many 301 redirects - good or bad?
Hi, Currently, page A is redirecting to page B. I am in the process of developing new site for the same domain and this time page B will be redirected to page C. This is gonna happen on many pages. Is it correct or should i adopt some other strategy? Will it have adverse effect on the speed of my site? Page A -----> Page B ------> Page C Regards, Shailendra
Technical SEO | | IM_Learner0