Your hosting two name based domains deurbellen.nl and fietsbellen.nl. For the domain fietsbellen.nl you have a SSL and non-SSL vhost configuration .
The domain deurbellen.nl has only a none-SSL vhost config plane and simple.
When a user connects to the site https://deurbellen.nl, there will be no error message telling the vhost (domain) doesn’t exist. Instead apache serves the site fietsbellen.nl in SSL……. Pretty weird!
This is default behavior for apache. It serves the first available SSL vhost when the requested one is not found.
For many reasons you just won’t want this to happen. This behavior can be changed by adding a vhost configuration that listens to *:443 and serve one of the apache error codes back to the client. For a complete list of error codes look here.
- Create a file named 10-localhost.localdomain-ssl.conf at the location apache reads your configuration files. On a RHEL/CentOS based os, the default location is /etc/httpd/conf.d
- opy the stuff below into your file
12345678910111213141516171819202122232425262728293031<VirtualHost *:443>ServerName localhost.localdomain## Vhost docrootDocumentRoot "/var/www/html/localhost.localdomain"## Directories, there should at least be a declaration for /var/www/html/localhost.localdomain<Directory "/var/www/html/localhost.localdomain">Options NoneAllowOverride NoneRequire all granted</Directory>## LoggingErrorLog "/var/log/httpd/localhost.localdomain/error-ssl_log.%Y.%m.%d 86400"ServerSignature OffCustomLog "/var/log/httpd/localhost.localdomain/access-ssl_log.%Y.%m.%d 86400" combined## Redirect rulesRedirect 404 /## Server aliasesServerAlias localhost.localdomain## SSL directivesSSLEngine onSSLCertificateFile "/etc/ssl/certs/localhost.localdomain.crt"SSLCertificateKeyFile "/etc/ssl/certs/localhost.localdomain.key"SSLOptions +StdEnvVars +ExportCertData</VirtualHost>
Checkout the config section Redirect rules
12## Redirect rulesRedirect 404 /
This tells apache which error code/page the client receives. So tweak it with the message you want to return
- Create a SSL cert and key for localhost.localdomain
Check this how to for creating certificates and stuff…
- Copy the new cert and key file to
- Restart apache and go test!