Mobile app version of vmapp.org
Login or Join
Tiffany637

: SSL issue and redirects from https to http 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

@Tiffany637

Posted in: #Apache2 #Https #Linux

I have a site 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 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 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.
pastebin.com/GCWhpQJq
NOTE: I tried solutions in .httaccess but none of those worked. Like redirecting 301 redirects etc

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Tiffany637

2 Comments

Sorted by latest first Latest Oldest Best

 

@Jamie184

Since app.example.com and 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_HOST}%{REQUEST_URI}

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

10% popularity Vote Up Vote Down


 

@Jessie594

You need to get a wildcard SSL certificate:

*.example.com


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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme