我最近将一个wordpress站点从服务器移到了我的本地环境,并且当我尝试访问wordpress站点时出现以下错误本地我的电脑上:错误310(net :: ERR_TOO_MANY_REDIRECTS):本地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网站到我的电脑的步骤:
我在MySQL数据库中导入的WordPress站点本地。
- 我在phpMyAdmin的wpkapi_options表中将siteurl更改为
http://localhost:8888/folder/site/
。
- 我在phpMyAdmin的wpkapi_options表中将siteurl更改为
我复制并粘贴从服务器上的所有文件到本地一个文件夹,名为/站点文件夹/
我编辑了wp-config.php文件以下的事情:
定义('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>
我有同样的问题,确保你已经添加了新的数据库用户具有相应权限。 – Webkix