I have a virtual domain (
www.ssltest.imsig.ca) that I would like to have accessed only through the https protocol. A previous post tried to address the subject
http://forums.contribs.org/index.php?topic=23230.msg98152#msg98152 but I was unable to get that to work.
What I have tried is a bit of a variant. I have a RewriteRule that gets generated only for the specified virtual domain. But I seem to be doing something wrong in specifying the regular expression. What I want to happen is that 'http://' gets replaced by 'https://' for any web access to this domain (ibay).
I have this as a custom template fragment for httpd.conf:
RewriteEngine on
{
return "" unless $virtualHost eq "ssltest.imsig.ca";
'RewriteRule ^http:\/\/(.*) https://$1 [L]';
}
I have tried a number of variants, but nothing seems to work. Generally what I get is the standard http: url -- as though nothing is matching the pattern and therefore no substitution is taking place.
I am open to suggestions (a) for a completely different approach and (b) for a better way to structure the RewriteRule.
Thanks for taking a look.
John