<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>OurApache &#187; AllowOverride</title>
	<atom:link href="http://ourapache.com/archives/tag/allowoverride/feed" rel="self" type="application/rss+xml" />
	<link>http://ourapache.com</link>
	<description>我们致力于一个Apache知识的分享网站</description>
	<lastBuildDate>Tue, 13 Apr 2010 05:18:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Apache AllowOverride 指令</title>
		<link>http://ourapache.com/archives/74</link>
		<comments>http://ourapache.com/archives/74#comments</comments>
		<pubDate>Fri, 06 Feb 2009 06:14:32 +0000</pubDate>
		<dc:creator>OurApache</dc:creator>
				<category><![CDATA[Apache基础知识]]></category>
		<category><![CDATA[AllowOverride]]></category>

		<guid isPermaLink="false">http://www.ourapache.com/?p=74</guid>
		<description><![CDATA[通常利用 apache 的 mod_rewrite 对 URL 进行重写的时候， rewrite 规则会写在 .htaccess 文件里。但要使 apache 能够正常的读取 .htaccess 文件的内容，需要对 .htaccess 所在目录进行配置。从安全性考虑，根目录一般都配置成不允许任何 Override ]]></description>
			<content:encoded><![CDATA[<p>通常利用 apache 的 mod_rewrite 对 URL 进行重写的时候， rewrite 规则会写在 .htaccess 文件里。但要使 apache 能够正常的读取 .htaccess 文件的内容，需要对 .htaccess 所在目录进行配置。从安全性考虑，根目录一般都配置成不允许任何 Override ，即</p>
<p>&lt;Directory /&gt;<br />
<a href="http://ourapache.com/archives/tag/allowoverride" class="st_tag internal_tag" rel="tag" title="标签 AllowOverride 下的日志">AllowOverride</a> None<br />
&lt;/Directory&gt;</p>
<p>在 AllowOverride 设置为 None 时， .htaccess 文件将被完全忽略。当此指令设置为 All 时，所有具有 “.htaccess” <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/directive-dict.html#Context" target="_blank"><span style="color: #44a1d0;">作用域</span></a>的指令都允许出现在 <code>.htaccess</code> 文件中。</p>
<p>AllowOverride 可用的指令如下：</p>
<dl>
<dt>AuthConfig </dt>
<dd>允许使用与认证授权相关的指令(<a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_authn_dbm.html#authdbmgroupfile" target="_blank"><span style="color: #44a1d0;">AuthDBMGroupFile</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_authn_dbm.html#authdbmuserfile" target="_blank"><span style="color: #44a1d0;">AuthDBMUserFile</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_authz_groupfile.html#authgroupfile" target="_blank"><span style="color: #44a1d0;">AuthGroupFile</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/core.html#authname" target="_blank"><span style="color: #44a1d0;">AuthName</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/core.html#authtype" target="_blank"><span style="color: #44a1d0;">AuthType</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_authn_file.html#authuserfile" target="_blank"><span style="color: #44a1d0;">AuthUserFile</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/core.html#require" target="_blank"><span style="color: #44a1d0;">Require</span></a>, 等)。 </dd>
<dt>FileInfo </dt>
<dd>允许使用控制文档类型的指令(<a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/core.html#defaulttype" target="_blank"><span style="color: #44a1d0;">DefaultType</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/core.html#errordocument" target="_blank"><span style="color: #44a1d0;">ErrorDocument</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/core.html#forcetype" target="_blank"><span style="color: #44a1d0;">ForceType</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_negotiation.html#languagepriority" target="_blank"><span style="color: #44a1d0;">LanguagePriority</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/core.html#sethandler" target="_blank"><span style="color: #44a1d0;">SetHandler</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/core.html#setinputfilter" target="_blank"><span style="color: #44a1d0;">SetInputFilter</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/core.html#setoutputfilter" target="_blank"><span style="color: #44a1d0;">SetOutputFilter</span></a>, <code class="module"><a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_mime.html" target="_blank"><span style="color: #44a1d0;">mod_mime</span></a></code>中的 Add* 和 Remove* 指令等等)、控制文档元数据的指令(<a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_headers.html#header" target="_blank"><span style="color: #44a1d0;">Header</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_headers.html#requestheader" target="_blank"><span style="color: #44a1d0;">RequestHeader</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_setenvif.html#setenvif" target="_blank"><span style="color: #44a1d0;">SetEnvIf</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_setenvif.html#setenvifnocase" target="_blank"><span style="color: #44a1d0;">SetEnvIfNoCase</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_setenvif.html#browsermatch" target="_blank"><span style="color: #44a1d0;">BrowserMatch</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_usertrack.html#cookieexpires" target="_blank"><span style="color: #44a1d0;">CookieExpires</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_usertrack.html#cookiedomain" target="_blank"><span style="color: #44a1d0;">CookieDomain</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_usertrack.html#cookiestyle" target="_blank"><span style="color: #44a1d0;">CookieStyle</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_usertrack.html#cookietracking" target="_blank"><span style="color: #44a1d0;">CookieTracking</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_usertrack.html#cookiename" target="_blank"><span style="color: #44a1d0;">CookieName</span></a>)、<code class="module"><a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_rewrite.html" target="_blank"><span style="color: #44a1d0;">mod_rewrite</span></a></code>中的指令(<a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_rewrite.html#rewriteengine" target="_blank"><span style="color: #44a1d0;">RewriteEngine</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_rewrite.html#rewriteoptions" target="_blank"><span style="color: #44a1d0;">RewriteOptions</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_rewrite.html#rewritebase" target="_blank"><span style="color: #44a1d0;">RewriteBase</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_rewrite.html#rewritecond" target="_blank"><span style="color: #44a1d0;">RewriteCond</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_rewrite.html#rewriterule" target="_blank"><span style="color: #44a1d0;">RewriteRule</span></a>)和<code class="module"><a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_actions.html" target="_blank"><span style="color: #44a1d0;">mod_actions</span></a></code>中的<a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_actions.html#action" target="_blank"><span style="color: #44a1d0;">Action</span></a>指令。 </dd>
<dt>Indexes </dt>
<dd>允许使用控制目录索引的指令(<a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_autoindex.html#adddescription" target="_blank"><span style="color: #44a1d0;">AddDescription</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_autoindex.html#addicon" target="_blank"><span style="color: #44a1d0;">AddIcon</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_autoindex.html#addiconbyencoding" target="_blank"><span style="color: #44a1d0;">AddIconByEncoding</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_autoindex.html#addiconbytype" target="_blank"><span style="color: #44a1d0;">AddIconByType</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_autoindex.html#defaulticon" target="_blank"><span style="color: #44a1d0;">DefaultIcon</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_dir.html#directoryindex" target="_blank"><span style="color: #44a1d0;">DirectoryIndex</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_autoindex.html#fancyindexing" target="_blank"><span style="color: #44a1d0;">FancyIndexing</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_autoindex.html#headername" target="_blank"><span style="color: #44a1d0;">HeaderName</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_autoindex.html#indexignore" target="_blank"><span style="color: #44a1d0;">IndexIgnore</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_autoindex.html#indexoptions" target="_blank"><span style="color: #44a1d0;">IndexOptions</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_autoindex.html#readmename" target="_blank"><span style="color: #44a1d0;">ReadmeName</span></a>, 等)。 </dd>
<dt>Limit </dt>
<dd>允许使用控制主机访问的指令(<a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_authz_host.html#allow" target="_blank"><span style="color: #44a1d0;">Allow</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_authz_host.html#deny" target="_blank"><span style="color: #44a1d0;">Deny</span></a>, <a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_authz_host.html#order" target="_blank"><span style="color: #44a1d0;">Order</span></a>)。 </dd>
<dt>Options[=<var>Option</var>,...] </dt>
<dd>允许使用控制指定目录功能的指令(<a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/core.html#options" target="_blank"><span style="color: #44a1d0;">Options</span></a>和<a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_include.html#xbithack" target="_blank"><span style="color: #44a1d0;">XBitHack</span></a>)。可以在等号后面附加一个逗号分隔的(无空格的)<a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/core.html#options" target="_blank"><span style="color: #44a1d0;">Options</span></a>选项列表，用来控制允许<a href="http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/core.html#options" target="_blank"><span style="color: #44a1d0;">Options</span></a>指令使用哪些选项。 </dd>
</dl>
<p>所以对于 URL rewrite 来说，至少需要把目录设置为</p>
<p>&lt;Directory /myblogroot/&gt;<br />
AllowOverride FileInfo<br />
&lt;/Directory&gt;</p>
<p><!-- 网摘代码 BEGIN --></p>
<h3  class="related_post_title">无相关文章，以下随机显示</h3><ul class="related_post"><li>2009年03月30号 -- <a href="http://ourapache.com/archives/234" title="Apache的prefork模式和worker模式">Apache的prefork模式和worker模式</a></li><li>2009年03月9号 -- <a href="http://ourapache.com/archives/227" title="通过SNMP协议来监视Apache服务器">通过SNMP协议来监视Apache服务器</a></li><li>2009年02月25号 -- <a href="http://ourapache.com/archives/168" title="apache ab压力测试收藏">apache ab压力测试收藏</a></li><li>2009年02月10号 -- <a href="http://ourapache.com/archives/123" title="Apache高级配置中文详解">Apache高级配置中文详解</a></li><li>2009年02月10号 -- <a href="http://ourapache.com/archives/121" title="apache 无法启动故障排查">apache 无法启动故障排查</a></li><li>2009年12月12号 -- <a href="http://ourapache.com/archives/310" title=".htaccess的301跳转">.htaccess的301跳转</a></li><li>2009年06月14号 -- <a href="http://ourapache.com/archives/253" title="Apache自动添加地址末尾的斜线">Apache自动添加地址末尾的斜线</a></li><li>2009年08月12号 -- <a href="http://ourapache.com/archives/265" title="关于apache的restart和stop, start的问题">关于apache的restart和stop, start的问题</a></li><li>2009年02月10号 -- <a href="http://ourapache.com/archives/114" title="apache + resin的多机部署方案实现方法">apache + resin的多机部署方案实现方法</a></li><li>2009年08月13号 -- <a href="http://ourapache.com/archives/281" title="Linux下Apache并发连接数和带宽控制">Linux下Apache并发连接数和带宽控制</a></li></ul>
	标签：<a href="http://ourapache.com/archives/tag/allowoverride" title="AllowOverride" rel="tag">AllowOverride</a>, <a href="http://ourapache.com/archives/category/basic" title="Apache基础知识" rel="tag">Apache基础知识</a><br />
]]></content:encoded>
			<wfw:commentRss>http://ourapache.com/archives/74/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

