2012-11-02 31 views
1

我希望有人能幫助我。我在我的網站上實現了一些mod_rewrite規則,它們都完美地工作。但是,我的網站託管帳戶通過將文件放置在我主站點目錄的子文件夾中來支持一個帳戶上的多個域。mod_rewrite問題添加域

我的mod_rewrite規則似乎干擾這些添加域。有誰知道我可以如何限制規則只是我的主要領域。然後,我也可以在子文件夾中添加新的.htaccess文件,爲每個添加域分別重寫規則。

這裏是我的.htaccess文件:

ErrorDocument 400 /?error=400 
ErrorDocument 401 /?error=401 
ErrorDocument 403 /?error=403 
ErrorDocument 404 /?error=404 
ErrorDocument 500 /?error=500 

RewriteEngine on 

RewriteRule \.(css|jpe?g|gif|png)$ - [L] 

RewriteCond %{REQUEST_URI} ^/[^\.]+[^/]$ 
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L] 


RewriteRule ^([^/\.]+)/?$ index.php?content=$1 [L,QSA] 
RewriteRule ^news/page/([0-9]+)/$ index.php?content=news&page=$1 [L,QSA] 
RewriteRule ^news/([0-9]+)/([^/\.]+)/?$ index.php?content=news&id=$1&ptitle=$2 [L,QSA] 
RewriteRule ^photos/page/([0-9]+)/$ index.php?content=photos&page=$1 [L,QSA] 
RewriteRule ^photos/gallery/([0-9]+)/$ index.php?content=photos&gallery=$1 [L,QSA] 
RewriteRule ^photos/gallery/([0-9]+)/page/([0-9]+)/$ index.php?content=photos&gallery=$1&page=$2 [L,QSA] 
RewriteRule ^music/release/([0-9]+)/([^/\.]+)/?$ index.php?content=music&release=$1&ptitle=$2 [L,QSA] 
RewriteRule ^edit_news/([0-9]+)/$ index.php?content=post_news&id=$1 [L,QSA] 
RewriteRule ^download/(.*)?$ media/downloads/$1 [L] 

回答

0

我曾與BlueHost的這個同樣的問題,這就是爲什麼我現在用的是虛擬專用主機,如prgmr.com

有沒有繞過它 - 所以Bluehost的幫助臺告訴我。 :(