subdomain redirect question



I have a subdomain (, which has a SSL certificate installed. Because of the way subdomains are set up, I can still access the content at

I would like to redirect all of the traffic to to ensure they are using the store with SSL.

I thought I would just redirect traffic using a redirect, but it warned me that it would cause a loop.

What's the best way to handle this?

You may use mod_rewrite.
i.e. add the following lines to your .htaccess (in subdomain root)

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
ensure to change the SERVER_NAME with your subdomain.

or you may use <VirtualHost>directives also.