Hi, I have a problem on my server with SSL sites. Ubuntu 10.04.4 LTS ISPConfig 3.0.5.3 Apache 2.2.14 The problem is simple: I have 1 web site with proper SSL certificate: https://www.example.com Works fine. But when users go to https://any-web-site.com they get the contents of https://www.example.com How can I do one of the following: - either return ERROR - or redirect visitors to some other DEFAULT https site, not to the particular one
What you describe is the normal behaviour of ssl sites under apache. If a site does nor exist on a specific port (in this case 443), then apache wil show the first website in alphabetical order that it finds for this port. You can avoid that by using separate IP addresses for ssl websites or by creating a default ssl site with domain name (000default.tld) so that this site comes first before all your other sites. the domain name does not have to exist.
In addition I also have added this to the .httaccess file of the 000default.tld site, so every request is redirected to the original visitors site Code: ## Default .htaccess file RewriteEngine On RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]