Post by growlbox » Sun Dec 30, 2012 12:41 am

I wanted to share my .htacces code for the people who would like to use an ssl.

First off, be sure to enable SSL in the admin area, Config -> Store-settings -> Server

Edit your .htaccess file ( in root folder );
  • RewriteBase /opencartsubfoler

    RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
    RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
    RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://www.opencartsite.com/opencartsubfoler/ [R]
The first line needs to be set if you're oc install is in a subfolder of root. in this case root/opencartsubfollder/
If OC is in your root folder leave the / so that the line looks like this --> "RewriteBase /"

Ignore line 2 to line 7.

RewriteCond %{HTTPS} off // Checks if the url has https:// if not then do...
RewriteRule (.*) https://www.opencartsite.com/opencartsubfoler/ [R]


What this does it redirects all non www (http://opencartsite.com/opencartsubfoler/) and www (http://www.opencartsite.com/opencartsubfoler/) to https://www.opencartsite.com/opencartsubfoler/





The only thing it doesn't do is redirect https://opencartsite.com/opencartsubfoler/ to https://www.opencartsite.com/opencartsubfoler/

Has anyone got an idea? I'm open for any critical suggestions or alternative solutions!

New member

Posts

Joined
Sat Jun 11, 2011 6:16 pm

Post by victorj » Tue Jan 01, 2013 11:45 pm

this can be done without .htaccess.

in config.php root and admin change all urls (change http to https) at beginning of file to:
https://www.opencartsite.com/opencartsubfoler/

opencart does the rewrite correctly.

Koeltechnische deurrubbers eenvoudig online op maat bestellen.
Alle niet stekplichtige onderdelen zoals scharnieren, sloten, randverwarming en verlichting voor alle typen koelingen en vriezers.
https://koelcel-onderdelen.com


User avatar
Expert Member

Posts

Joined
Sat Jun 25, 2011 4:09 am
Location - Alkmaar Holland
Who is online

Users browsing this forum: No registered users and 5 guests