Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi,
I would like to know how to configure HTTP redirection with code 301.
Currently, the redirection type is 307, which means when I navigated http://mysite.com, I will be redirected to https//mysite.com with a code 307.
I would like to configure the redirection with code 301 which is more friendly to SEO.
In general, this can be handled at the .htaccess file, but in Shopify, that's not possible.
Anyone can help?
Thanks in advance.
In Shopify, you cannot directly modify the .htaccess file to configure HTTP redirection. However, you can achieve a 301 redirection by using Shopify's built-in URL redirects feature. Here's how you can do it:
Thanks for the help, but the idea you mentioned doesn't work in case I need to set the redirection for the homepage because Redirect from option only accepts subpages.
Did anyone figure this out? I am also trying to redirect all traffic from http:// to https:// for SEO reasons.
Yep. No change needed because this is not an SEO issue because a 301 is already happening.
The 307 you may be seeing in devtools is a cached HSTS redirect.
This is what is happening in a diagram:
From:
Website security: A vital factor to maintain - OVHcloud Blog
If you provide your website URL I can demonstrate this a few ways.
Where are you seeing the HTTP307 and have you eliminated HSTS and local caching?
From memory 307 that is a cached redirect code in Chrome, meaning the server is not responding with a 307, but rather Chrome is intercepting the outgoing request and serving a 'local redirect' from its in-browser cache first.
So there may not necessarily be a problem to fix here.
The problem is that Google Search Console says that the current type of Shopify Redirection from http: to https: is non-canonical, resulting in your root domain not being indexed by Google.
Familiar with those concepts, but not that error you are describing.
What error in GSC are you actually seeing? Screenshot would be good.
Where and how are you seeing HTTP307?
Here is a screen shot. I'm not able to discern if it is a 307, but the way Shopify is redirecting my http: to https: doesn't seem to impress Google.
That looks normal. Only the https should be indexable.
A standard Shopify redirect setup will look like this:
Note how only one version is indexable - that is the default way Shopify does it, and it is best SEO practise too.
Happy to do the same check on your site if you share the domain?
Hi KieranR,
You can see the HTTPS 307 in the network tab after visiting any Shopify site without entering the s in the http.
For example:
1- Open browser in Incognito mode
2- Visit the shop by "HTTP" only => example: http://shopify.com
You should be able to see the 307 redirect.
Yeah that's right, but for me - only on second reload after the redirect had been cached in that example.
If you see the 307 in devtools and you go one more click, open the Headers tab, it shows it's an internal redirect with no server IP, because it's being served from the client-side internal redirect cache.
This is not a redirect that Googlebot sees from the server response. Server is sending a 301 response every time.
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024