cancel
Showing results for 
Search instead for 
Did you mean: 

Magento Rewrite sends HTTP product URL to homepage SLL

Magento Rewrite sends HTTP product URL to homepage SLL

Hello,

 

I have recently installed SLL on one of my clients magento websites. Everything is working fine apart from one thing, product page urls are not redirecting from http:// to https://, they are redirecting to the homepage instead.

 

Any idea what is causing this?

 

Thank you.

1 REPLY 1

Re: Magento Rewrite sends HTTP product URL to homepage SLL

Hi.

 

Yes that is because Magento does this by default. You can get around this by adding the following to your public/.htaccess

 

RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteCond %{REQUEST_METHOD} !=POST
RewriteRule ^https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

 

Make sure you put it after the "RewriteEngine On" bit. It will always 301.

 

Regards,

Andy

Problem solved? Click Accept as Solution!
www.iwebsolutions.co.uk | Magento Small Business Partner