Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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.

http://pastebin.com/GCWhpQJq

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

share|improve this question
add comment

2 Answers

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
add comment

You need to get a wildcard SSL certificate:

*.example.com

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
add comment

Your Answer

 
discard

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.