gpt4 book ai didi

wordpress - 使用 htaccess 重定向 Wordpress 网站

转载 作者:行者123 更新时间:2023-12-02 03:23:25 25 4
gpt4 key购买 nike

情况

数据存储在 http://aplhazone.myserver.com 上.

域名是 http://betazone.com CNAME 记录可能在哪里(我无权访问服务器配置)。

这是带有自己的 htaccess 的 WordPress:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>
# END WordPress

期望的行为

重定向来自 http://aplhazone.myserver.com 的所有流量(可能是 301)和 http://www.betazone.com收件人 http://betazone.com .

不成功的尝试

案例一

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.betazone.com$ [OR]
RewriteCond %{HTTP_HOST} ^aplhazone.myserver.com$
RewriteRule ^(.*)$ http://betazone.com/$1 [R=301,L]

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>

# END WordPress

案例二

Redirect 301 / http://betazone.com/

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>

# END WordPress

常见错误

首先

The page isn't redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

This problem can sometimes be caused by disabling or refusing to accept cookies.

第二

The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. This problem can sometimes be caused by disabling or refusing to accept cookies

第三

Charles Error Report
Failed to connect to remote host

Charles failed to connect to the remote host. Check that your Internet connection is ok and that the remote host is accessible. Maybe your network uses a proxy server to access the Internet? You can configure Charles to use an external proxy server in the External Proxy Settings.

The actual exception reported was:

java.net.ConnectException: Connection timed out: connect

Charles Proxy, http://www.charlesproxy.com/

我做错了什么?

最佳答案

尝试以下操作

RewriteEngine On
RewriteCond %{HTTP_HOST} !^betazone\.com [NC]
RewriteRule (.*) http://betazone.com/$1 [R=301,L]

重写条件规定,如果主机名不是以 betazone.com 开头,则重定向到 betazone.com。所以 www.betazone.com 和 alphazone.myserver.com 将被重定向到 betazone.com

关于wordpress - 使用 htaccess 重定向 Wordpress 网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31727218/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com