2010-06-14 165 views
2

我讀了大量的網頁,並嘗試了很多解決方案,但都沒有工作過!討厭的WordPress重定向循環(尾部斜線,沒有斜線等)

我的問題是:

test.asifa.net/asifa-wp

重定向到:

test.asifa.net/asifa-wp/

哪個重定向到第一頁。

什麼是有點離奇的是ASIFA-WP生產:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> 
<html><head> 
<title>301 Moved Permanently</title> 
</head><body> 
<h1>Moved Permanently</h1> 
<p>The document has moved <a href="http://test.asifa.net/asifa-wp/">here</a>.</p> 
</body></html> 

而ASIFA-WP /產生一個空白頁面,但是下面的標題(捲曲-v輸出):

* About to connect() to test.asifa.net port 80 (#0) 
* Trying 69.163.203.138... connected 
* Connected to test.asifa.net (69.163.203.138) port 80 (#0) 
> GET /asifa-wp/ HTTP/1.1 
> User-Agent: curl/7.18.2 (i386-redhat-linux-gnu) libcurl/7.18.2 NSS/3.12.0.3 zlib/1.2.3 libidn/0.6.14 libssh2/0.18 
> Host: test.asifa.net 
> Accept: */* 
> 
< HTTP/1.1 301 Moved Permanently 
< Date: Sun, 13 Jun 2010 05:40:12 GMT 
< Server: Apache 
< X-Powered-By: PHP/5.2.13 
< X-Pingback: http://test.asifa.net/asifa-wp/xmlrpc.php 
< Set-Cookie: _icl_current_language=en; expires=Mon, 14-Jun-2010 05:40:12 GMT; path=/asifa-wp/ 
< Location: http://test.asifa.net/asifa-wp 
< Vary: Accept-Encoding 
< Content-Length: 0 
< Content-Type: text/html; charset=UTF-8 

的.htaccess看起來像:

# BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase /asifa-wp/ 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /asifa-wp/index.php [L] 

</IfModule> 

# END WordPress 

任何幫助都將非常感謝!

回答

0
<?php 
/* 
Plugin Name: Disable Canonical URLs 
Description: Disable Canonical URLs 
Version: .1 
Author: Aaron 
Author URI: http://aahacreative.com/ 
*/ 

remove_filter('template_redirect', 'redirect_canonical'); 
?> 

嘗試將其保存到.php文件並在wordpress安裝中激活它。

+0

Aaron, 非常感謝您的回覆! 我已經嘗試將該行放入functions.php中......我剛剛嘗試了它作爲插件,正如您所建議的那樣,但不幸的是問題仍然存在。 也許一個線索是,一個301似乎在PHP甚至開始之前就已經發生了..用curl -v檢查標題... – 2010-06-15 05:15:26

+0

帶斜線的url雖然啓動PHP。確保你的主機在apache配置本身沒有設置任何規則。 最糟糕的情況下,提交日誌的支持票或讓他們看看。 – 2010-06-15 05:39:35