Wordpress 导致“此网页有重定向循环"远程错误 [英] Wordpress causing "This webpage has a redirect loop" error remotely

查看:56
本文介绍了Wordpress 导致“此网页有重定向循环"远程错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在开发中运行良好的 Wordpress 站点(位于 mysite.dev),但是当我将它部署到我的远程服务器 (mysite.com) 时抛出此网页有重定向循环"错误.

I have a Wordpress site that works perfectly well in development (at mysite.dev), however when I deploy it to my remote server (mysite.com) it throws the 'This webpage has a redirect loop' error.

我可以在加载栏中看到浏览器一次又一次地尝试 www.mysite.com 然后 mysite.com 然后 www.mysite.com 但是我不确定这是否相关.

I can see in the loading bar that the browser is trying www.mysite.com then mysite.com then www.mysite.com again and again, however I'm not sure if this is relavant or not.

如果我的 Wordpress 数据库配置不正确,我会收到 建立数据库连接时出错 消息,但是当一切设置正确时,它会在这个重定向循环中中断.

If my Wordpress database configuration is incorrect, I get the Error establishing a database connection message, however when everything is set correctly it breaks in this re-direct loop thing.

我已更改数据库中的字段 (siteurl) 以反映远程设置 (http://mysite.com/wordpress).

I have changed the field in the database (siteurl) to reflect the remote settings (http://mysite.com/wordpress).

注意:除了wp-config.phpindex.php之外,我的wordpress文件都存储在我的根目录下一个名为wordpress的文件夹中> 和 .htaccess.

Note: My wordpress files are stored in a folder called wordpress in my root directory except for wp-config.php, index.php and .htaccess.

有什么想法吗?

.htaccess 内容:

.htaccess contents:

# 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

index.php:

<?php
/**
 * @package WordPress
 */
define('WP_USE_THEMES', true);

require('./wordpress/wp-blog-header.php');
?>

推荐答案

我的托管服务器设置强制 mysite.com 访问 www.mysite.com,这导致了问题.我关闭了此设置,现在一切正常,不过,我仍然想知道如何在打开此设置的情况下使其正常工作!

My hosted server settings were forcing mysite.com to www.mysite.com and this was causing the problem. I turned this setting off and everything works now, i'd still like to know how to make it work with this setting turned on, though!

这篇关于Wordpress 导致“此网页有重定向循环"远程错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆