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 client who has a PHP website hosted by Apache. The website is for internal use only, but they still want their employees to be able to access it from their phones and home computers. The client is concerned about security and wanted the whole website to use https instead of http, so they bought an SSL certificate. Right now, forwards to . also forwards to . Both of these forwards are correct. However, does not forward to the non-www version, which is incorrect. Not only that, but it displays the "Red Hat Enterprise Linux Test Page"! I don't know a whole lot about SSL certificates, but from what I've read, it sounds like I'll need another SSL certificate for the www version of the URL even though all I'll be doing is forwarding it to the non-www version of the URL. Does that sound right? What do you recommend I do in this situation?

This is what my virtual host configuration looks like (only with the correct IP address and hostname, of course):

<VirtualHost *:80>

    Redirect permanent /

    DocumentRoot "/var/www/"

    <Directory /var/www/>
        Options All
        AllowOverride All

        SSLOptions +StrictRequire
        SSLRequire %{HTTP_HOST} eq ""

    ErrorLog /var/log/httpd/
    LogLevel warn
    CustomLog /var/log/httpd/ combined
    ServerSignature Off

    SSLEngine on
    SSLCertificateFile /etc/httpd/certificates/
    SSLCertificateKeyFile /etc/httpd/certificates/
    SSLCertificateChainFile /etc/httpd/certificates/
share|improve this question

Most chep SSL certs these days support the domain with and without www. You should check with the company your client purchased the cert from to make sure it was set up for this.

However, if that were the only problem, you'd see an SSL warning, not the default page, when visiting

SSL does not play well with VirtualHosts. Are there other sites hosted on the machine? If not, can the VirtualHosts and set up everything under the default.

share|improve this answer
There are other sites hosted on the machine – Nick Apr 19 '12 at 17:03
Then you need to add a dedicated IP address for this one domain, and change the DNS to point to it. Or -- if this is the only domain that supports SSL, you could move its config to the default, and make sure you have VirtualHosts set up for all other domains. – xofer Apr 19 '12 at 17:04

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.