Apache之AllowOverride參數詳解

來源:互聯網
上載者:User

標籤:des   style   blog   io   color   使用   sp   for   strong   

通常利用Apache的rewrite模組對 URL 進行重寫的時候, rewrite規則會寫在 .htaccess 檔案裡。但要使 apache 能夠正常的讀取.htaccess 檔案的內容,就必須對.htaccess 所在目錄進行配置。從安全性考慮,根目錄的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指令使用哪些選項。

Apache之AllowOverride參數詳解

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.