在我的网络服务器上,我将 domain_A.tld 的默认主机设置为重定向到 domain_B.tld。(这是为了捕获与定义的主机不匹配的 HTTPS 连接并将它们引至 domain_B.tld。)我最近添加了 subdomain_C.domain_B.tld,或者尝试使用以下 VirtualHost 来添加。
subdomain_C.domain_B.tld 的 VirtualHost 是:
<VirtualHost *:443>
ServerName ____
ServerAlias ____
DirectoryIndex index.cgi index.shtml index.html index.html.var
DocumentRoot /____
ErrorLog /var/log/apache2/_____error.log
CustomLog /var/log/apache2/_____access.log combined
SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/____/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/____/privkey.pem
SSLCACertificateFile /etc/letsencrypt/live/____/cert.pem
ServerAdmin ____
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory ____>
Options ExecCGI Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/____.error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/____.log combined
</VirtualHost>
domain_B.tld 的 VirtualHost 是:
<VirtualHost *:443>
ServerName ____
ServerAlias ____
DirectoryIndex index.php index.cgi index.shtml index.html index.html.var
DocumentRoot /____
ErrorLog /var/log/apache2/_____error.log
CustomLog /var/log/apache2/_____access.log combined
SSLEngine On
SSLCertificateFile /____/fullchain.pem
SSLCertificateKeyFile /____/privkey.pem
SSLCACertificateFile /____/cert.pem
ServerAdmin ____
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /____/>
Options ExecCGI Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/____.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/____.log combined
RewriteEngine on
RewriteRule ^____$ ____ [R=301,L]
RewriteRule ^____$ /____/$1 [R=301,L]
</VirtualHost>
然而,发生的事情是,我尝试连接到https://子域名_C.域名_B.tld被引导至https://domain_B.tld。
我很难确定这一点。Apache (服务器版本:Apache/2.4.10 (Debian);服务器建立时间:2015 年 11 月 28 日 14:05:48) 启动时没有报告错误,并且目录 /etc/letsencrypt/live/subdomain_C.domain_B.tld 已填充。当我尝试使用之前未要求加载的另一个浏览器加载页面时,此行为始终出现https://子域名_C.域名_B.tld。另外,我尝试指定的根目录包含一个静态 index.html 作为其唯一的 index.*,并且 index.html 文件很简单,根本没有元刷新或 JavaScript。
我还应该去哪里寻找https://子域名_C.域名_B.tld显示 index.html 文件而不重定向到https://domain_B.tld还是其他不同地点?
谢谢,