Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting SSL as Single Domain not Whole Root.

Status
Not open for further replies.

altendew

Programmer
Mar 29, 2005
154
0
0
US
I currently bought https:// for my site dtdyno.com. The problem is that if you type https:// for my other sites it will forward to
For example:

goes to goes to
I do not want it to-do that for the other domains, only dtdyno.com.

Here is my a chunk from my httpd.conf

Code:
<IfDefine SSL>
<VirtualHost 66.98.242.36:443>
ServerAlias [URL unfurl="true"]www.dtdyno.com[/URL] dtdyno.com
BytesLog domlogs/secure2.dtdyno.com-bytes_log
ServerName secure2.dtdyno.com
ScriptAlias /cgi-bin/ /home/dtdyno/public_html/cgi-bin/
ServerAdmin webmaster@dtdyno.com
DocumentRoot /home/dtdyno/public_html
User dtdyno
Group dtdyno
SSLEnable
SSLCertificateFile /home/dtdyno/ssl/certs/dtdyno.com.crt
SSLCertificateKeyFile /home/dtdyno/ssl/private/dtdyno.com.key
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
</VirtualHost>
</IfDefine>

Sincerely,
Andrew Rosolino
 
Do not use https in the url of the other domains. This tells apache to listen on port 443 and the other domains don't mactch so it servers the only one defined for port 443. You need to specify the port for each vhost container i.e. <VirtualHost *:80> and your ssl domain would be <VirtualHost *:443>. Common practice is to create both for secure sites. Then use links to the secure pages simply by using https in the url.


 
But what if I want to get another domain name secure in the future? I dont like the fact that if someone did add https it will forward to another domain. If that server does not have https I do not want it to-do anything.
 
The two domains that you mention resolve to the same IP address. Set the other domain up with its own virtualhost section using a different IP address.
 
I think you would have the same problem if someone types Apache wouldn't find it on port 443 and use the first vhost defined as the default. You may want to use a rewrite rule or some sort of redirect.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top