我有两个域名是https://app.example.com其中SSLconfiguration和另一个是http://www.example.com (SSL是为此网站configuration较早的时候http://应用程序。 example.com没有SSL),没有configurationSSL。
问题是,当我的用户错误地inputhttps://www.example.com这不是一个SSL启用的网站。 显示用户的SSL启用网站的内容。
https://app.example.com和http://www.example.com都位于具有相同IP地址的同一台服务器上。
如何限制用户应该显示用户input的网站的内容。 (即时通讯知道,当用户将打我的非SSLfunction的网站,他们将显示SSL证书警告,但这不是问题。)
在这种情况下, mod_rewrite模块应该是有帮助的。 您可以尝试将这些规则放到您的SSL虚拟主机定义中:
RewriteEngine On # enable mod rewriting engine RewriteCond %{HTTPS} on # if is was used RewriteCond %{HTTP_HOST} ^www\.example\.com [NC] # and if the host is www.example.com RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [L] # then rewrite the url it to http