2013-10-26 25 views
0

我的網站主要有域名&子域具有htaccess的重寫問題,對目錄的.htaccess重寫規則似乎並不只針對子域

我的問題是,有htaccess的代碼下www.example.com,

工作
RewriteBase/
Options +FollowSymLinks 
RewriteEngine On 
RewriteRule ^([^?]*).html$ content.php?pid=$1 

當我使用url路徑www.example.com/test.html或www.example.com/folder/test.html創建內容頁時,它工作得很好。

但我在我的子域&'文件夾'網址不起作用的代碼相同。我的意思是subdomain.example.com/test.html工作正常,但subdomain.example.com/folder/test.html似乎並沒有工作。

非常感謝提前.. :)請幫助...

+0

您必須首先知道如何爲虛擬主機配置文件中的子域定義VirtualDocumentRoot。 – jacouh

+0

'但我在我的子域上有相同的代碼'請在此處發佈。 – anubhava

+0

是anubhava,我已經在子域的htaccess代碼中也有該代碼..但它不起作用 – user2672112

回答

0

可以嘗試在你的子域的.htaccess驗證碼:

Options +FollowSymLinks -MultiViews 

RewriteEngine On 
RewriteBase /subdomain/ 

RewriteRule ^([^.]+)\.html$ subdomaincontent.php?pid=$1 [L,NC,QSA] 

確保有以下subdomain沒有其他.htaccess