Sunday, January 4, 2015

apache2 https redirect to http without ssl cert

We have an apache server which hosts multiple domains from, which some have https enabled and some do not.



Now the problem is that if I access https://exampleWithoutHttps I will come to the content of https://exampleWithHttps.



I would like to forward the user from https://exampleWithoutHttps to http://exampleWithoutHttps on all domains whithout https. I have tried to create a redirect rule in virtualhost *:443 but this creates the following error:



Server should be SSL-aware but has no certificate configured



The problem is that I cant change "Listen 443" to "Listen 443 http" as this would break my hosts with ssl enabled.




Is there a way I could have a redirect without a ssl certificate ?



Or if not possible can you propose an alternative which would ensure that https://exampleWithoutHttps does not show the content of https://exampleWithHttps.



My ports.conf




NameVirtualHost *:80
Listen 80
NameVirtualHost *:443

Listen 443


mi site condfig:




DocumentRoot /path/to/dr
ServerName exampleWithoutHttps.com
ServerAlias www.exampleWithoutHttps.com




ServerName exampleWithoutHttps.com
ServerAlias www.exampleWithoutHttps.com
Redirect permanent / http://www.exampleWithoutHttps.com/

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...