2

I'm sure this is simple, but I can't quite work it out.

My Magento website has several (duplicate) URL's:

http://www.example.com
http://www.example.com/index.php/  
https://www.example.com/
https://www.example.com/index.php

I want them all linking to the https version of example.com

I tried adding the following in my htaccess root file:

RewriteEngine On
RewriteCond %{HTTPS} !^on$
RewriteRule (.*) https://www.example.com/$1 [R,L]

RewriteCond %{THE_REQUEST} ^.*/index.php 
RewriteRule ^(.*)index.php$ https://www.example.com/$1 [R=301,L]

but it doesn't work (it means I can no longer access my www.example.com/admin site). Any ideas? I'm sure this must be a common thing with Magento?

3

No need to change anything in .htaccess file. Please revert back to it's original.

Go to system > configuration > web > secure and set your secure url (with https). Make sure you add "/" at the end of your url (https://www.example.com/index.php/).

Then set Use Secure URLs in Frontend to Yes

Clean your cache and you are done.

If you want to remove index.php from your site, then read this.

  • 1
    If you want all pages to use https only, you should also change the base url in the "unsecure" section. "Use Secure URLs in Frontend" only applies to login and checkout. – Fabian Schmengler Jul 2 '15 at 6:44
  • Thanks @fschmengler for pointing that too. Although, without setting secure url in "unsecure" section, it should work. – Adarsh Khatri Jul 2 '15 at 6:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.