Webmasters Stack Exchange is a question and answer site for pro webmasters. 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 site www.example.com for which i purchased SSL cert and installed.

And it was working fine, I also have a subdomain with app.example.com which was not on SSL.

Both www.example.com and app.example.com are on same IP address.

At later we decided to put SSL only on app.exapmle.com and then i configured SSL with app.example.com and it worked fine,

Now the issue is that Google is indexing my site as https://www.example.com/ and when users hits the web , Invalid security warning is issued and when user allow security issue they are shown my app.example.com contents.

Note: I have my SSL configuration files in /etc/httpd/conf.d/ssl.conf

The contents of the ssl.conf are below.


NOTE: I tried solutions in .httaccess but none of those worked. Like redirecting 301 redirects etc

share|improve this question

Since app.example.com and www.example.com are on the same IP adress, using https on either of the 2 will use the defined VirtualHost in your ssl.conf, since you did not specify a servername:

Line 84: #ServerName example.com:443

What you need is VirtualHost on port 443 redirects to http for a given servername

RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}

See: http://stackoverflow.com/questions/8371/how-do-you-redirect-https-to-http

share|improve this answer

You need to get a wildcard SSL certificate:


The * makes it wildcard and thus you can use it on www.example.com and app.example.com

share|improve this answer
I do not want to purchase a wildcard certificate. I want www.example.com on non HTTPS as this is my static contents. – Asghar Oct 24 '13 at 9:22
please read the answer above by Ronald Swets, that is another option you have. – jjohnson Oct 28 '13 at 12:17

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.