不知道什么时候,但WHM/cPanel和/或Apache已经改变了他们处理不存在的域的请求的方式。
以前它会重定向到http://requested-domain.tld/cgi-sys/defaultwebpage.cgi,但现在它只会显示虚拟主机中列出的第一个域的内容,而不会更改域。
我尝试添加以下变量:
/etc/apache2/conf.d/includes/pre_virtualhost_2.conf
/etc/apache2/conf.d/000-default.conf
<VirtualHost *>
ServerName subdomain.server-domain.tld
RedirectPermanent / /cgi-sys/defaultwebpage.cgi
#RewriteEngine on
#RewriteCond %{HTTPS} on
#RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
#RewriteCond %{HTTPS} off
#RewriteRule ^/(.*)$ /cgi-sys/defaultwebpage.cgi [L,R=302]
</VirtualHost>
也不将请求重定向到http://requested-domain.tld/cgi-sys/defaultwebpage.cgi
有人有什么建议吗?
1条答案
按热度按时间v64noz0r1#
将以下内容添加到
/etc/apache2/conf.d/includes/pre_virtualhost_global.conf
解决了问题:对于具有多个IP地址的服务器,您需要为每个IP进行复制。
https://support.cpanel.net/hc/en-us/articles/360061002473-How-do-I-set-a-default-VirtualHost-for-each-IP-address-