Category: Articles
Posted: Feb 2, 2010
Synopsis: Further protect your x-cart admin and provider sections by forcing the use of https using this .htaccess code for x-cart.
It is always a good idea to log into your x-cart admin section using https so that the data you transact during the x-cart session is encrypted. The following code will force your x-cart admins/providers to login using https:// by redirecting them when http:// is used.
Add this code to the .htaccess of your admin section (adjust your url):
# Force https on the admin section
RewriteEngine On
RewriteCond %{SERVER_PORT} !443
RewriteRule ^(.*)$ https://www.your-domain.com/xcart-dir/admin/$1 [R=301,L]
Add this code to the .htaccess of your provider section (adjust your url):
# Force https on the provider section
RewriteEngine On
RewriteCond %{SERVER_PORT} !443
RewriteRule ^(.*)$ https://www.your-domain.com/xcart-dir/provider/$1 [R=301,L]