如何查看apache配置文件路径
#httpd -V
查看加载模块
#httpd -t -D DUMP_MODULES
防止header头host攻击
RewriteEngine On
RewriteBase /
–禁止非法域名访问.返回404错误页面. power by cefhost
–判断规则,若有多个域名则写多条.(除了以下域名,其他均不允许访问)
rewritecond %{http_host} !^cefhost.cn$ [nc]
rewritecond %{http_host} !^www.cefhost.net$ [nc]
rewritecond %{http_host} !^www.cefhost.cn$ [nc]
–禁止规则
rewriterule ^.* - [F,L]