Question

I am trying to enforce https on an existing magento website, so far so good, the website gets always correctly redirected to the https URL configured in the backend.

As of my understanding the correct way to redirect the old http urls is with a 301 permanent redirect. However I am not sure my configuration is correct since from the network developer tool I see this pattern 301 -> 302 -> 200 (as in the following image).

enter image description here

Is this correct or should I investigate further?

Information about the server: Magento 1.8.1; Ubuntu 16.04; Apache 2; Php 5;

Was it helpful?

Solution

Ok, I found out what the problem was about.

Instead of configuring the unsecure URL with the https one, I configured the url with the http one and then modified the .htaccess to handle the redirect as follows:

## http to https redirect 301 ##

    RewriteCond %{HTTPS} off [OR]
    RewriteCond %{HTTP_HOST} ^www\. [NC]
    RewriteRule ^ https://your.url.here.com:8444%{REQUEST_URI} [R=301,L,NE]
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top