httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey Williams <>
Subject [users@httpd] url rewrite to fix ssl issue with aliased domain name
Date Thu, 12 Apr 2007 09:15:59 GMT
my dns is set up with my domain name cnamed to my webserver e.g. IN CNAME

my server is also running a wildcard cert for my domain.

Now when people come to the site by following a link for, or type in the address bar, all is 
good with the world.

However if they follow link for, or type, they 
get a certname does not match hostname error. (apparently wildcard certs 
don't work for domain names without a subdomain or hostname prepended)

Anyway I have tried to use rewrite rules to fix this following are the 
two forms I tried:

RewriteCond "%{HTTP_HOST}" "^mydomain\.com" [NC]
RewriteRule "^/(.*)" "$1" [R]


RewriteCond "%{HTTP_HOST}" "!^www\.mydomain\.com" [NC]
RewriteCond "%{HTTP_HOST}" "!^$"
RewriteRule "^/(.*)" "$1" [R]

neither seems to work, the address bar still shows without 
the www. and the cert warning still shows that the requested hostname as without the www.

by the way I have about a dozen other rewrite rules all following these 
ones that seem to be working ok.

any suggestions as to what I am doing wrong, or another way to solve 
this problem, would be appreciated.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message