我希望将键入login.abcde.com
的用户重定向到https://client1.abcde.com
并阻止所有其他 HTTP URL。因此,如果有人键入http://client1.abcde.com/thispage/isawesome.html,它将显示一些错误消息或 404。到目前为止,我尝试将以下内容添加到我的 httpd.conf 中,但没有成功。我不断收到 Apache 页面说:This page is used to test the proper operation of the Apache HTTP server after it has been installed. If you can read this page, it means that the web server installed at this site is working properly, but has not yet been configured.
重写引擎开启
RewriteCond %{HTTPS} 关闭
重写规则 ^client1.abcde.com$ https://client1.abcde.com [L,R=301]
顺便说一句,我正在使用 Apache 和 WSGI。我的 80 端口的虚拟主机基本上就是:
<VirtualHost *:80>
ServerAdmin abisson@abcde.com
DocumentRoot /srv/www/abcde/html
ErrorLog "logs/error_log"
CustomLog "logs/access_log" common
</VirtualHost>