Redirect to HTTPS

Category: X-Cart Snippets
Added:
Enter Price $
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]