2013-07-12 57 views
1

我最近將一個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/
  • 我複製並粘貼從服務器上的所有文件到本地一個文件夾,名爲/站點文件夾/

  • 我編輯了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> 
+0

我有同樣的問題,確保你已經添加了新的數據庫用戶具有相應權限。 – Webkix

回答

1

我是一個完整的WP小白所以記住這一點。我在wp-config.php文件中讀到,可以將數據庫表的前綴從'wp'更改爲任何內容,所以我將其更改爲'tbl'。

在此之後沒有太多時間,我開始在FireFox中發現「太多重定向」,並且在Choome中出現了「此頁面有重定向循環」。 IE不會顯示 - 沒有錯誤。

我根據FireFox清除了cookie並開始挖掘。所以我將表前綴改回到「wp」(我所做的最後一個配置類型更改),保存了更改並停止了重定向。

我承認,這並不直接說你的問題,但我覺得它很有趣,一個「簡單」的變化導致東西太意外了。

相關問題