禁用apache OPTIONS方法

时间:2014-10-30 12:01:26   收藏:0   阅读:2320

        使用apache的重写规则来禁用OPTIONS方法。方法如下:

在apache配置文件http.conf中添加以下代码:
LoadModule  rewrite_module  path/to/apache/modules/mod_rewrite.so
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS)
RewriteRule .* - [F]



参考文章:

http://www.techstacks.com/howto/disable-http-methods-in-apache.html

http://www.linuxquestions.org/questions/linux-security-4/disabling-head-options-http-methods-in-apache-webserver-763347/

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!