2012-04-13 48 views
0

我正在嘗試將一個子目錄重定向到一個子域,但它似乎下面的RewriteBase導致錯誤500.我怎樣才能使重定向發生在子目錄上,並仍然讓所有其他規則工作何時在子域上?Subdomain .htaccess的子目錄問題

Options +FollowSymlinks 
RewriteEngine On 

# redirect to mbp subdomain 
RewriteCond %{HTTP_HOST} !^mbp\.fasttracksites\.com 
RewriteCond %{REQUEST_URI} ^/mbp/ 
RewriteRule ^(.*)$ http://mbp.fasttracksites.com/$1 [R=301,END,QSA] 

RewriteBase/

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
# MBP Rules 
RewriteRule ^module/([A-Za-z-_]+)/([A-Za-z-_]+)/?$ /index.php?p=module&prefix=$1&module_page=$2 [NC,QSA,L] 
RewriteRule ^module/([A-Za-z-_]+)/([A-Za-z-_]+)/([A-Za-z-_]+)/?$ /index.php?p=module&prefix=$1&module_page=$2&page=$3 [NC,QSA,L] 
RewriteRule ^module/([A-Za-z-_]+)/([A-Za-z-_]+)/([0-9]+)/?$ /index.php?p=module&prefix=$1&module_page=$2&id=$3 [NC,QSA,L] 
RewriteRule ^([A-Za-z-_]+)/?$ /index.php?p=$1 [NC,QSA,L] 
RewriteRule ^([A-Za-z-_]+)/([A-Za-z-_]+)/?$ /index.php?p=$1&s=$2 [NC,QSA,L] 
RewriteRule ^([A-Za-z-_]+)/([A-Za-z-_]+)/([0-9]+)/?$ /index.php?p=$1&s=$2&id=$3 [NC,QSA,L] 

回答

0

RewriteBase不應該給出500錯誤。

問題出在您正在使用的不存在的END標誌中。我認爲你的意思是L標誌。

RewriteRule ^(.*)$ http://mbp.fasttracksites.com/$1 [R=301,L,QSA] 
+0

呀有它爲L之前,但看到結束文檔在mod_rewrite的這麼嘗試了兩個給出一個錯誤500,這裏的地方,這是在URL:http://www.fasttracksites.com/mbp/ – spyke01 2012-04-14 20:19:47

+0

嘗試刪除代碼塊,直到500錯誤消失。 500錯誤通常意味着你在你的htaccess中有一些語法錯誤。 – Gerben 2012-04-15 09:53:23

+0

得到它一直下降到這一點,仍然有錯誤500:選項+ FollowSymlinks RewriteEngine在 RewriteBase/ – spyke01 2012-04-15 13:16:42