1

I have a client which has 302 redirected all the http pages to https pages 4 years ago. Now is it recommended to change all the 302 redirections to 301 or should I keep them the same? Also they have 302 redirected http://example.com website to https://www.example.com and then 301 redirect https://www.example.com version to https://example.com and making a redirection chain. What is the best practice for SEO in this case? Thanks a lot for your help in advance:)

2
  • Nothing wrong with redirect chains as long as they are not excessive, you're concerned about a non-problem. 99.999% of your visitors will use the link on Google, with no redirects. Commented Sep 24, 2018 at 10:58
  • 1
    @SimonHayter Redirect chains are OK, but the one in the question is a bit of a silly one and should be fixed.
    – MrWhite
    Commented Sep 24, 2018 at 14:55

1 Answer 1

2

Https redirects

In the Google official guide, they recommend using 301 redirect for https redirections, so you need to change 302 for 301.

Redirect your users and search engines to the HTTPS page or resource with server-side 301 HTTP redirects.

Multiple redirects

Try to avoid unnecessary redirects cause it slows down your page load speed. Here you have an optimized Apache .htaccess configuration.

RewriteEngine On
RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
# [NC] is a case-insensitive match
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

You can also set your preferred domain access in Google Search Console.

1
  • "avoid unnecessary redirects" - ironically, these directives result in a double redirect when requesting http://www.example.com. However, that isn't necessarily a bad thing (and is actually required if later configuring HSTS).
    – MrWhite
    Commented Sep 26, 2018 at 15:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.