RE: url rewrite to fix ssl issue with aliased domain name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Jeffrey Williams [mailto:jeff@xxxxxxxxxxxxx] 
> Sent: Thursday, April 12, 2007 11:16 AM
> To: users@xxxxxxxxxxxxxxxx
> Subject:  url rewrite to fix ssl issue with 
> aliased domain name
> 
> my dns is set up with my domain name cnamed to my webserver e.g.
> 
> mydomain.com IN CNAME www.myname.com
> 
> my server is also running a wildcard cert for my domain.
> 
> Now when people come to the site by following a link for 
> www.mydomain.com, or type www.mydomain.com in the address bar, all is 
> good with the world.
> 
> However if they follow link for mydomain.com, or type 
> mydomain.com, 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 "^/(.*)" "http://www.mydomain.com/$1"; [R]
> 
> and
> 
> RewriteCond "%{HTTP_HOST}" "!^www\.mydomain\.com" [NC]
> RewriteCond "%{HTTP_HOST}" "!^$"
> RewriteRule "^/(.*)" "http://www.mydomain.com/$1"; [R]
> 
> neither seems to work, the address bar still shows 
> mydomain.com without 
> the www. and the cert warning still shows that the requested 
> hostname as 
> mydomain.com without the www.

First step when debugging mod_rewrite is to switch on the rewrite log at
a verbose level (see docs for details) and see what's actually
happening. My guess is that the request is not getting to the rule..

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 

> 
> 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.
> 
> Thanks,
> Jeff
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP 
> Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>    "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>
 
 
This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please notify the sender urgently and then immediately delete the message and any copies of it from your system. Please also immediately destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. The sender's company reserves the right to monitor all e-mail communications through their networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of the sender's company.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux