2011-09-17 67 views
1

我在運行WordPress 3.1.4多站點的網站上遇到了一個小問題,但令人討厭的問題。防止子頁面重定向到根URI

導航到沒有「http:// www」的子頁面的URI(例如「abetterworldbydesign.com/2011-conference/」)會導致重定向到根節點「http://www.abetterworldbydesign.com」 。

意圖是「abetterworldbydesign.com/2011-conference/」重定向到「http://www.abetterworldbydesign.com/2011-conference/」。

.htaccess文件在下面(它是specific stuff for WordPress Multisite)。

# BEGIN WordPress 
RewriteEngine On 
RewriteBase/
RewriteRule ^index\.php$ - [L] 

# uploaded files 
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L] 

# add a trailing slash to /wp-admin 
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] 

RewriteCond %{REQUEST_FILENAME} -f [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule^- [L] 
RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L] 
RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L] 
RewriteRule . index.php [L] 
# END WordPress 

回答

1

嘗試在非常頂部添加此

RewriteCond %{HTTP_HOST} ^abetterworldbydesign.com 
RewriteRule ^(.*)$ http://www.abetterworldbydesign.com/$1 [R=301,L] 

,只是RewriteEngine On後。