httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Pasher <>
Subject Re: [users@httpd] Question about SSL and Apache and a certificate error
Date Mon, 29 Sep 2008 21:07:56 GMT
Mike Soultanian wrote:
> Our campus has an SSL certificate for  If you go to 
> everything works peachy.
> Now, if you go to, you get an error.  I talked to 
> our server admin and he said it's because our certificate is 
> registered to and not  He said only a 
> wildcard certificate would fix this problem, but that something that 
> the campus doesn't want to do for security and cost reasons.
> So, is it possible to set up a rewrite condition such that when 
> someone tries to navigate to, it will automatically 
> redirect the user to and avoid the certificate 
> error?  I tried using the following in a .htaccess file and it didn't 
> work (still got the error):
> RewriteEngine on
> RewriteCond %{HTTPS} on
> RewriteCond %{HTTP_HOST} !www
> RewriteRule (.*) http://www.%{HTTP_HOST}%{REQUEST_URI} [R]
> I thought maybe if the above code was put somewhere in the httpd.conf 
> file it might work?
> It seems like a long-shot (admin didn't think it'd work), but I 
> figured I'd ask the experts here.  Any other possible ways to work 
> around this?
> Thanks!
> Mike

You can simplify this a bit by saying "redirect anything that is not 
going to". However, you'll have to put the rewrite 
directives inside the <VirtualHost> configuration for the SSL version of 
the site, as the .htaccess file is run after a connection is established 
with the browser.

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.csulb\.edu$
RewriteRule ^/(.*)$$1 [R=permanent,L]

Justin Pasher

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