Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a server I host multiple sites on like,, I am trying to add a secure site at It's the only one I want to use the secure connection.

I set up everything and it seemed to work, but as soon as I visit it redirects all my other sites to https until I clear browser cache. Is there a setting I can use to help keep the http traffic from redirecting to https? contents default-ssl config below.

<IfModule mod_ssl.c>
<VirtualHost _default_:443>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/
    <Directory /var/www/site4>
            RackBaseURI /site4
            RackEnv production
            Options -MultiViews

    ErrorLog ${APACHE_LOG_DIR}/error.log
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined

    SSLEngine on
    SSLCertificateFile    /path/to/cert
    SSLCertificateKeyFile /path/to/key
    SSLCertificateChainFile /path/to/chain/file

    <FilesMatch "\.(cgi|shtml|phtml|php)$">
            SSLOptions +StdEnvVars
    <Directory /usr/lib/cgi-bin>
            SSLOptions +StdEnvVars

    BrowserMatch "MSIE [2-6]" \
            nokeepalive ssl-unclean-shutdown \
            downgrade-1.0 force-response-1.0
    BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
share|improve this question
You're sure it redirects you? I see no directive there that would cause a redirect by Apache. I did notice myself that when you type a host name in the Firefox address bar, it picks up earlier entries from history sometimes without me noticing and I experience similar result as what you are describing. Maybe try actually typing to confirm. – ETL Feb 18 '13 at 17:36
SSL is set up based on domain name, you don't really restrict to to a folder within the subdomain. From what I see, the three links you provide all seem to have the same domain. Is this correct? – drone.ah Feb 19 '13 at 22:44
correct. The SSL cert is for on which I've got /site1, /site2, and /site3 in a virtual host listening on port 80. /site4 is in the virtualhost replicated above listening on 443.It occurs to me, now that you mention it, that enabling of the ssl engine doesn't happen within the context of a virtualhost. Since files are just a logical separation and make no difference to the server that applies to the virtualhost on port 80, even htough it's in a different file. That sound about right? Is there a way to fix it? – biagidp Feb 20 '13 at 14:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.