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:
In your Shopify admin, go to “Online Store” → “Navigation”.
Scroll down to the “URL redirects” section and click on “Manage”.
Click on the “Add URL redirect” button.
In the “Redirect from” field, enter the old URL that you want to redirect from (e.g., http://mysite.com).
In the “Redirect to” field, enter the new URL that you want to redirect to (e.g., https://mysite.com).
Set the “Redirect type” to “Permanent (301)”.
Click on the “Save” button to create the URL redirect.
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.
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.
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.
Hello, in this case, the URL redirect is not intended for http to https (no security certificate to secure with a security certificate) of the same page. Shopify automatically issues the SSL certificate, and those notifications or errors are viewed under Settings > Domains. Click into your Domain and you’ll see a similar screen. The instructions provided in this thread for creating redirects from one page to another will work. This example does not work because it’s the same page; you can’t redirect to itself. The protocol of HTTPS or HTTP is not a different page. Hope this helps someone visiting this thread.