You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

 

We can achieve this using mod_rewrite which is already compiled into your Apache web server here at GlowHost.com

This will redirect any access to the non-secure site to the secure site at https://yourdomain.com

Make sure you have an SSL certificate for your domain!

 

Stick this in your .htaccess file:

 

RewriteEngine On 
RewriteCond %{SERVER_PORT} !^443$ 
RewriteRule (.*) https://yourdomain.com/ [L]

 

If you want to simply redirect all requests for a certain directory, for example your shopping cart installation, you can do something like:

 

RewriteEngine On 
RewriteCond %{REQUEST_URI} ^/cart/.*
RewriteCond %{SERVER_PORT} !^443$ 
RewriteRule (.*) https://yourdomain.com/ [L]

 

 

 

 

  • No labels