我为我们的主要网站www.example.com设置了一个测试服务器。我将apache-sites config设置为www2.example.com。我删除了.htaccess /调整它以保存基本的wordpress-条目。我禁用了浏览器的自动完成。
当我进入www2.example.com时,我会被重定向,永久地移动到www.www2.example.com。
当我进入192.168.0.1时,我会被重定向到www.www2.example.com。
有人能说出错误可能在哪里吗?
.htaccess:
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPresssites-config for the first vHost:
Protocols h2 http/1.1
ServerAdmin info@example.de
DocumentRoot /var/www/html/
ServerName www2.example.de
ServerAlias www2.example.de
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Order allow,deny
allow from all
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerAdmin info@example.de
Protocols h2 h2c http/1.1
DocumentRoot /var/www/html/
ServerName www2.example.de
ServerAlias www2.example.de
# added 01.04.2019 BEGINN
Options -Indexes +FollowSymLinks
AllowOverride all
Order allow,deny
allow from all
# added 01.04.2019 END
Options -Indexes +FollowSymlinks
AllowOverride All
Require all granted
allow from all
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine offsites-config for second vHost
Protocols h2 http/1.1
ServerAdmin info@example.de
DocumentRoot /var/www/html1/example2/
ServerName www2.example2.eu
ServerAlias www2.example2.eu
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Order allow,deny
allow from all
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combinedThe request- and response-header for www2.example.de
Connection: Keep-Alive
Content-Length: 236
Content-Type: text/html; charset=iso-8859-1
Date: Wed, 26 May 2021 10:41:46 GMT
Expires: Wed, 26 May 2021 10:42:46 GMT
Keep-Alive: timeout=5, max=100
Location: https://www.www2.example.de/
Server: Apache
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip, deflate
Accept-Language:de,en-US;q=0.7,en;q=0.3
Cache-Control: no-cache
Connection: keep-alive
DNT: 1
Host: www2.example.de
Pragma: no-cache
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0发布于 2021-05-27 05:40:09
SNI将请求发送到Live,而不是测试服务器。而有重写规则。
发布于 2021-05-26 16:46:56
您应该检查WordPress站点网址设置。如果站点URL与当前虚拟主机主机名不匹配,WordPress将向站点URL发送301重定向。
https://serverfault.com/questions/1064734
复制相似问题