Redirect to HTTPS

Category: X-Cart Snippets
Added:
Enter Price $
SKU SKU821122
Quantity

With Google giving a ranking boost to secure websites, here is how to automatically redirect to HTTPS...

Add this code to your root .htaccess file (before any URL re-writing rules)...

RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
The website uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy.
More Information