欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  网络运营

Apache之AllowOverride参数使用说明

程序员文章站 2023-09-05 21:54:10
从安全性考虑,根目录的allowoverride属性一般都配置成不允许任何override ,即 < directory /> allowoverride no...
从安全性考虑,根目录的allowoverride属性一般都配置成不允许任何override ,即
< directory />
allowoverride none
< /directory>

在 allowoverride 设置为 none 时, .htaccess 文件将被完全忽略。当此指令设置为 all 时,所有具有 “.htaccess” 作用域的指令都允许出现在 .htaccess 文件中。

而对于 url rewrite 来说,至少需要把目录设置为
< directory /myblogroot/>
allowoverride fileinfo
< /directory>

allowoverride的参数:


authconfig
允许使用与认证授权相关的指令(authdbmgroupfile, authdbmuserfile, authgroupfile, authname, authtype, authuserfile, require, 等)。

fileinfo
允许使用控制文档类型的指令(defaulttype, errordocument, forcetype, languagepriority, sethandler, setinputfilter, setoutputfilter, mod_mime中的 add* 和 remove* 指令等等)、控制文档元数据的指令(header, requestheader, setenvif, setenvifnocase, browsermatch, cookieexpires, cookiedomain, cookiestyle, cookietracking, cookiename)、mod_rewrite中的指令(rewriteengine, rewriteoptions, rewritebase, rewritecond, rewriterule)和mod_actions中的action指令。

indexes
允许使用控制目录索引的指令(adddescription, addicon, addiconbyencoding, addiconbytype, defaulticon, directoryindex, fancyindexing, headername, indexignore, indexoptions, readmename, 等)。

limit
允许使用控制主机访问的指令(allow, deny, order)。

options[=option,...]
允许使用控制指定目录功能的指令(options和xbithack)。可以在等号后面附加一个逗号分隔的(无空格的)options选项列表,用来控制允许options指令使用哪些选项。