首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误地重定向到www.www2.example.de的原因是什么

问错误地重定向到www.www2.example.de的原因是什么
EN

Server Fault用户
提问于 2021-05-26 08:30:19
回答 2查看 78关注 0票数 0

我为我们的主要网站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:

代码语言:javascript
复制
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

sites-config for the first vHost:

代码语言:javascript
复制
     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 off

sites-config for second vHost

代码语言:javascript
复制
     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 combined

The request- and response-header for www2.example.de

代码语言:javascript
复制
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
EN

回答 2

Server Fault用户

回答已采纳

发布于 2021-05-27 05:40:09

SNI将请求发送到Live,而不是测试服务器。而有重写规则。

票数 0
EN

Server Fault用户

发布于 2021-05-26 16:46:56

您应该检查WordPress站点网址设置。如果站点URL与当前虚拟主机主机名不匹配,WordPress将向站点URL发送301重定向。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1064734

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档