httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Schaefer <>
Subject [users@httpd] SSL and subdomain redirects
Date Tue, 31 Jan 2012 21:11:36 GMT
My server hosts all requests to, i.e., 
<>,,, etc. By all, I mean all 
that do not have a pre-defined DNS record to tell the client to go 
somewhere else. I have an SSL certificate that is only valid for 

not even I haven't been able to find a good answer to my 
question, since it involves rewrites in different cases. Here's what I 
want to do:

if HTTP_HOST == ''
      // All requests for, regardless of SSL, redirect to 
SSL www site
      redirect to 

else if HTTP_HOST == '' 

and SERVER_PORT != 443
      // For non-SSL requests to www, redirect to SSL www
      redirect to 

else if SERVER_PORT == 443
      // For any other requests that are trying to use SSL, redirect to 
non-SSL of the same domain name
      redirect to http://HTTP_HOST/theRestOfTheURL 

Carry out other RewriteRules I may have in place

I would prefer to be able to accomplish this with .htaccess rules only. 
But if I need to accomplish this with a combination of .htaccess rules 
AND Apache configuration changes, I'm ok with that too. Thank you in 
advance!Let me know if you need more information.

Dan Schaefer
Web Developer/Systems Analyst
Performance Administration Corp.
ph 800-405-3148

View raw message