我最近将一个wordpress网站从服务器移动到我的本地环境,当我尝试在我的计算机上本地访问wordpress网站时,我收到以下错误:
This webpage has a redirect loop
The webpage at `http://localhost:8888/folder/site/` has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.
Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.
但是我可以在本地转到http://localhost:8888/folder/site/wp-admin
并登录并查看wordpress网站的后端。
这些是我将wordpress网站从服务器升级到我的计算机所采取的步骤:
我在本地的wordpress网站的MySQL数据库中导入。
http://localhost:8888/folder/site/
。 我将本地服务器上的所有文件复制并粘贴到名为folder / site /
的文件夹中我在wp-config.php文件中编辑了以下内容:
define('DB_NAME','localdb');
define('DB_USER','root');
define('DB_PASSWORD','root');
然后我去了localhost:8888/folder/site/
并看到了上面的错误。我继续尝试以下方法来尝试解决此错误:
我清除了所有的饼干,但这不起作用。我尝试了不同的浏览器,但是没有用。
I changed the siteurl in the database from `http://localhost:8888/folder/site/` to `localhost:8888/folder/site/` and then tried `http://www.localhost:8888/folder/site/` but they both didn’t work.
我通过将插件文件夹的名称从插件更改为aplugins来停用所有插件,但这不起作用。
我尝试评论标题('位置:./');在index.php中,这不起作用。
我甚至尝试在org_1.htaccess文件中注释掉以下内容,但这不起作用:
# 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>
答案 0 :(得分:1)
我是一个完整的WP noob所以请记住。我在wp-config.php文件中看到,可以将数据库表的前缀从'wp'更改为任何内容,因此我将其更改为'tbl'。
在那之后没多少时间,我开始在FireFox中获得“太多的重定向”,并且Choome中的“此页面有一个重定向循环”。 IE不会显示 - 没有错误。
我根据FireFox清除了cookie并开始挖掘。所以我将表前缀更改回“wp”(我所做的最后一次配置类型更改),保存了更改,并停止了重定向。
我认识到这并不能直接解决你的问题,但我觉得有趣的是,“简单”的改变导致了一些意想不到的事情。