Magento makes 307 redirect to HTTPS instead of 301
-
12-12-2019 - |
Question
I have set my whole frontend to use HTTPS. But in the headers I see that if I go to http://example.com Magento redirects me to the HTTPS version using 307 redirect. I tried to change this by setting in .htaccess:
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
but it didn't help.
What should I do to make Magento use 301 redirect instead of 307?
(I am using CE 1.9.1.0)
Solution
The 307 redirect is in real a 307 Internal Redirect
done by the Chrome Browser because the domain is known to require/support Strict Transport Security
So its not done by your Magento.
OTHER TIPS
A typo in your sites configuration (maybe in your vhost settings for your webserver), it is nowhere defined in Magento.
Did a grep -R 307
in a clean Magento and found nothing related to your problem.
See https://stackoverflow.com/questions/2068418/whats-the-difference-between-a-302-and-a-307-redirect