【发布时间】:2013-07-11 03:14:35
【问题描述】:
我最近将一个 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 数据库。
- 我在 phpMyAdmin 的 wpkapi_options 表中将 siteurl 更改为
http://localhost:8888/folder/site/。
- 我在 phpMyAdmin 的 wpkapi_options 表中将 siteurl 更改为
我将所有文件从本地服务器复制并粘贴到一个名为 folder/site/ 的文件夹中
-
我在 wp-config.php 文件中编辑了以下内容:
define('DB_NAME', 'localdb');
define('DB_USER', 'root');
define('DB_PASSWORD', 'root');
然后我去了localhost:8888/folder/site/,看到了上面的错误。我继续尝试以下方法来尝试解决此错误:
我清除了所有的 cookie,但没有奏效。我尝试了其他浏览器,但还是不行。
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.
我通过将插件文件夹的名称从 plugins 更改为 aplugins 来停用所有插件,但没有奏效。
我尝试注释掉 header('Location: ./');在 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>
【问题讨论】:
-
我遇到了同样的问题,请确保您已添加具有适当权限的新数据库用户。
标签: wordpress