我最近將一個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