說明:確定允許存在于.htaccess
文件中的指令類型
語法:AllowOverride All|None|directive-type [directive-type] ...
當服務器發現一個.htaccess
文件(由AccessFileName
指定)時,它需要知道在這個文件中聲明的哪些指令能覆蓋在此之前指定的配置指令。
AllowOverride
僅在不包含正則表達式的<Directory>
配置段中才是有效的。在<Location>
, <DirectoryMatch>
, <Files>
配置段中都是無效的。如果此指令被設置為None
,那么.htaccess文件將被完全忽略。事實上,服務器根本不會讀取.htaccess
文件。
當此指令設置為 All
時,所有具有".htaccess"作用域的指令都允許出現在.htaccess
文件中。
directive-type可以是下列各組指令之一:
AuthDBMGroupFile
, AuthDBMUserFile
, AuthGroupFile
, AuthName
, AuthType
, AuthUserFile
, Require
, 等)。 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
指令。 AddDescription
, AddIcon
, AddIconByEncoding
, AddIconByType
, DefaultIcon
, DirectoryIndex
, FancyIndexing
, HeaderName
, IndexIgnore
, IndexOptions
, ReadmeName
, 等)。 Allow
, Deny
, Order
)。 Options
和XBitHack
)??梢栽诘忍柡竺娓郊右粋€逗號分隔的(無空格的)Options
選項列表,用來控制允許Options
指令使用哪些選項。 例如:以下指令只允許在.htaccess
中使用AuthConfig
和Indexes
組的指令:
AllowOverride AuthConfig Indexes
不在這兩組中的指令將會導致服務器產生一個內部錯誤。
新聞熱點
疑難解答