2011-09-21 77 views
0

我有一個.htaccess文件影響我的子域文件夾,我該如何防止發生。希望子域獨立運行.htaccess文件。這裏是我的.htaccess代碼.htaccess不影響其他文件夾

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^([a-zA-Z]*)/?$ goto.php?page=$1 
ErrorDocument 404 PageNotFound 
IndexIgnore * 

####Protect the system from machines with worms 
RewriteRule (cmd|root)\.exe - [F,E=dontlog:1] 

##Search Business 
RewriteRule %{QUERY_STRING} search.php?id=$1 

RewriteRule ^Customise/([0-9]*)/([A-Za-z-]*)$ customise.php?id=$1 

#### To hold and redirect css/images/js files 
RewriteRule images/(.+)?$ images/$1 [NC,L] 
RewriteRule css/(.+)?$ css/$1 [NC,L] 
RewriteRule js/(.+)?$ js/$1 [NC,L] 
RewriteRule uploads/(.+)?$ uploads/$1 [NC,L] 
+2

試試這個http://stackoverflow.com/questions/3135530/urgent-how-to-stop-htaccess-to-work-on-a-subdomain – Peeyush

回答

1

設置AllowOverride選項Nonehttpd-conf對子域目錄(見Apache docs)。

+0

謝謝,但文件位於何處?我在哪裏設置它,在子目錄或? – Cyberomin

+0

@Cyber​​omin它是你的Apache實例的配置文件(基本上,你在哪裏配置子域,模塊等)。 Windows的默認路徑是'Program Files \ Apache Group \ Apache \ conf';對於Linux,它位於'/ etc/conf /'中。在上面的評論中查看Peeyush的鏈接,這是正確的。 – Lyth

相關問題