2013-01-31 173 views
0

任何人都可以HALP我这个.htaccess文件,我一直想破例,所以我可以访问我的子域是 form.domain.com 我试着用 的RewriteCond%{REQUEST_URI}! ?^ /表格/ $ 和其他一些命令,但没有运气的.htaccess的RewriteCond

的.htaccess:

####################### 
# N - T H I N G ! # 
####################### 

# Apache options 
Options +FollowSymLinks -Indexes 
RewriteEngine on 

# Allow only GET and POST verbs 
RewriteCond %{REQUEST_METHOD} !^(GET|POST)$ [NC,OR] 

# Ban Typical Vulnerability Scanners and others 
# Kick out Script Kiddies 
RewriteCond %{HTTP_USER_AGENT} ^(java|curl|wget).* [NC,OR] 
RewriteCond %{HTTP_USER_AGENT} ^.*(libwww-perl|curl|wget|python|nikto|wkito|pikto|scan|acunetix).* [NC,OR] 
RewriteCond %{HTTP_USER_AGENT} ^.*(winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner).* [NC,OR] 

# Error Page 
ErrorDocument 404 /404 

# Redirect attachments 
RewriteRule ^files/attachments/(.*)/(.*)/(.*)$ files/attachments/$1/$2/$3 [L] 

# Redirect all requests to index.php 
RewriteRule ^(.*)$ index.php [L,QSA] 

回答

0

要匹配你应该使用%{HTTP_HOST}为域中:

RewriteCond %{HTTP_HOST} ^form.domain.com$ 
RewriteRule ^.*$ - [L] 

这表示如果域名与form.domain.com匹配,则允许URL并停止处理规则。

查看Apache documentation了解更多详情。