<?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>三水清htaccess</title>
	<atom:link href="http://js8.in/tag/htaccess/feed" rel="self" type="application/rss+xml" />
	<link>http://js8.in</link>
	<description>专注前端开发,分享Javascript/CSS/PHP等Web前端开发技巧</description>
	<lastBuildDate>Sat, 21 Apr 2012 02:50:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>简单修改.htaccess来提高Yslow等级</title>
		<link>http://js8.in/471.html</link>
		<comments>http://js8.in/471.html#comments</comments>
		<pubDate>Thu, 04 Feb 2010 05:40:49 +0000</pubDate>
		<dc:creator>三水清</dc:creator>
				<category><![CDATA[软件心得]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://www.js8.in/471.html</guid>
		<description><![CDATA[最近一直在修改我的爱墙程序，其中对Yslow等级进行了优化，本文从启用Gzip压缩、配置ETags、设置过期时间三个等级标准来提高Yslow等级，使用的方法就是修改htaccess，不需要修改程序代码既可以提高Yslow等级<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="设置htaccess应该注意的问题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F366.html&from=http%3A%2F%2Fjs8.in%2F471.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10990937.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">设置htaccess应该注意的问题</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="提高网站访问速度的十个技巧" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F670.html&from=http%3A%2F%2Fjs8.in%2F471.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10978720.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">提高网站访问速度的十个技巧</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="通过修改注册表去掉windows7的快捷方式小箭头" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F542.html&from=http%3A%2F%2Fjs8.in%2F471.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/20/30377978.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">通过修改注册表去掉windows7的快捷方式小箭头</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery插件pager修改版-更加智能" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F63.html&from=http%3A%2F%2Fjs8.in%2F471.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/11005364.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery插件pager修改版-更加智能</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>最近一直在修改我的<a target="_blank" title="爱墙许愿送祝福" href="http://love.js8.in" target="_blank">爱墙程序</a>，其中对于<strong>Yslow的等级</strong>纳入了考虑，之前的空间不支持自定义<strong>htaccess</strong>文件，现在的空间支持自定义htaccess，在以前的文章中我写过一篇关于htaccess的文章，今天我在结合<strong>爱墙许愿送祝福</strong>（http://love.js8.in）的网站，来说说通过修改htaccess达到Yslow优化，等级提高的方法，大家可以看看<a target="_blank" href="http://love.js8.in" target="_blank">http://love.js8.in</a>的Yslow等级已经到了<strong>B</strong>，分数是85~87之间，由于网站使用了jQuery的FaceBox插件以及量子统计，所以等级有点降低，可是总体等级是不大会变的，其实我就是通过修改htaccess达到Yslow优化的，这是最直接的方法，不需要修改程序代码既可以提高Yslow等级~废话不说啦，进入正题吧。</p>
<div id="attachment_470" class="wp-caption aligncenter" style="width: 456px"><a href="http://js8.in/wp-content/uploads/2010/02/Snap2.jpg"><img class="size-full wp-image-470 " title="简单修改htaccess文件提高Yslow等级优化" src="http://js8.in/wp-content/uploads/2010/02/Snap2.jpg" alt="简单修改htaccess文件提高Yslow等级优化" width="446" height="341" /></a><p class="wp-caption-text">简单修改htaccess文件提高Yslow等级优化</p></div>
<p><span id="more-471"></span></p>
<h3>Add an Expires header / 为文件头指定过期时间</h3>
<p>Expires是浏览器Cache机制的一部分，浏览器的缓存取决于Header中的四个值： Cache-Control， Expires， Last-Modified， ETag。这个项目的考评主要针对Cache-Control和<strong>Expires</strong>。</p>
<p>具体的Cache原理不是本文所涉及的，有兴趣的童鞋可以看看<a target="_blank" href="http://www.mnot.net/cache_docs/" target="_blank">Caching Tutorial一文</a>。为了优化这个选项，我们所要做的是对站内所有的文件有针对性的设置Cache-Control和Expires，要提高<strong>Yslow</strong>的等级就要在htaccess中设置文件头的过期时间，一般对于ico、jpg、gif、png、js、css之类的文件一般是不会发生变化的，所以我们可以设置的过期时间长一点。看我的htaccess文件内容：</p>
<blockquote><p>&lt;IfModule mod_expires.c&gt;<br />
ExpiresActive On<br />
ExpiresDefault A600<br />
ExpiresByType image/x-icon A2592000<br />
ExpiresByType application/x-javascript A2592000<br />
ExpiresByType application/javascript A2592000<br />
ExpiresByType text/javascript A2592000<br />
ExpiresByType text/css A604800<br />
ExpiresByType image/gif A2592000<br />
ExpiresByType image/png A2592000<br />
ExpiresByType image/jpeg A2592000<br />
ExpiresByType text/plain A86400<br />
ExpiresByType application/x-shockwave-flash A2592000<br />
ExpiresByType video/x-flv A2592000<br />
ExpiresByType application/pdf A2592000<br />
ExpiresByType text/html A600<br />
&lt;/IfModule&gt;</p></blockquote>
<h3>Gzip components / 启用Gzip压缩</h3>
<p><strong>Gzip</strong>可以压缩网页，达到更快的传输速度，如果你想使用Gzip请首先确认你的服务器是否支持Gzip<strong>压缩</strong>模块，然后htaccess中加入如下代码：</p>
<blockquote><p>&lt;IfModule mod_deflate.c&gt;<br />
SetOutputFilter DEFLATE<br />
AddOutputFilterByType DEFLATE text/html text/css image/gif image/jpeg image/png application/x-javascript text/javascript application/javascript<br />
&lt;/IfModule&gt;</p></blockquote>
<h3>Configure ETags / 配置ETags</h3>
<p>ETag响应头可以占用一部分的带宽，所以我们可以设置为<strong>none</strong>，<strong>htaccess配置</strong>如下：</p>
<blockquote><p>FileETag none</p></blockquote>
<div class="copyright">
<strong>声明：</strong>文章未声明为原创文章，本文链接 <a href="http://js8.in/471.html" title="简单修改.htaccess来提高Yslow等级">http://js8.in/471.html</a>. 转载请注明转自<a href="http://js8.in" title="前端开发博客"> JS8.IN ™</a></span></span></div>
<h3 class="box-title">随机文章</h3>
<ul class="box_random">
<li><a href="http://js8.in/467.html" title="Javascript设置光标位置到结尾并显示出来" rel="bookmark inlinks">Javascript设置光标位置到结尾并显示出来</a></li>
<li><a href="http://js8.in/518.html" title="使用Apache htpasswd.exe来管理SVN帐户" rel="bookmark inlinks">使用Apache htpasswd.exe来管理SVN帐户</a></li>
<li><a href="http://js8.in/682.html" title="最短的DOMReady代码" rel="bookmark inlinks">最短的DOMReady代码</a></li>
<li><a href="http://js8.in/983.html" title="addEventListener第二个参数的handleEvent" rel="bookmark inlinks">addEventListener第二个参数的handleEvent</a></li>
<li><a href="http://js8.in/752.html" title="使用html5 postMessage和window.name实现多浏览器跨域" rel="bookmark inlinks">使用html5 postMessage和window.name实现多浏览器跨域</a></li>
<li><a href="http://js8.in/788.html" title="在Express和Socket.IO中使用session" rel="bookmark inlinks">在Express和Socket.IO中使用session</a></li>
<li><a href="http://js8.in/415.html" title="利用浏览器书签实现的网页划词翻译工具" rel="bookmark inlinks">利用浏览器书签实现的网页划词翻译工具</a></li>
<li><a href="http://js8.in/54.html" title="终于搞明白yu.js的使用方法啦~" rel="bookmark inlinks">终于搞明白yu.js的使用方法啦~</a></li>
</ul>
<hr />
<p><small>© 三水清 for <a href="http://js8.in">三水清</a>, 2010. |
<a href="http://js8.in/471.html#comments">2 comments</a> |在微博关注我：<a href="//weibo.com/sanshuiqing" target="_blank" title="关注断桥残雪的新浪微博">@清-三水清</a>
<br/>收藏到：
<a rel="nofollow" href="http://share.renren.com/share/buttonshare.do?link=%posturl%&title=%posttitle%" title="收藏本文到人人网" target="_blank">人人网</a> | <a rel="nofollow" href="http://www.douban.com/recommend/?url=%posturl%&title=%posttitle%" title="收藏本文到豆瓣" target="_blank">豆瓣</a> | <a rel="nofollow" href="http://www.kaixin001.com/repaste/share.php?rtitle=%posttitle%&rurl=%posturl%" title="收藏本文到开心网" target="_blank">开心网</a> | <a rel="nofollow" href="http://shuqian.qq.com/post?title=%posttitle%&%20uri=%posturl%" title="收藏本文到QQ书签" target="_blank">QQ书签</a> | <a rel="nofollow" href="http://v.t.sina.com.cn/share/share.php?url=%posturl%&title=%posttitle%" title="收藏本文到新浪微博" target="_blank">新浪微博</a> | <a rel="nofollow" href="http://v.t.qq.com/share/share.php?title=%posttitle%&url=%posturl%&site=http://www.kaixin100.info" title="收藏本文到腾讯微博" target="_blank">腾讯微博</a>
<br/>
Post tags: <a href="http://js8.in/tag/htaccess" rel="tag">htaccess</a><br/>
</small></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="设置htaccess应该注意的问题" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F366.html&from=http%3A%2F%2Fjs8.in%2F471.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10990937.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">设置htaccess应该注意的问题</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="提高网站访问速度的十个技巧" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F670.html&from=http%3A%2F%2Fjs8.in%2F471.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10978720.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">提高网站访问速度的十个技巧</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="通过修改注册表去掉windows7的快捷方式小箭头" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F542.html&from=http%3A%2F%2Fjs8.in%2F471.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/20/30377978.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">通过修改注册表去掉windows7的快捷方式小箭头</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="jQuery插件pager修改版-更加智能" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F63.html&from=http%3A%2F%2Fjs8.in%2F471.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/11005364.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery插件pager修改版-更加智能</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://js8.in/471.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>设置htaccess应该注意的问题</title>
		<link>http://js8.in/366.html</link>
		<comments>http://js8.in/366.html#comments</comments>
		<pubDate>Mon, 07 Dec 2009 10:32:56 +0000</pubDate>
		<dc:creator>三水清</dc:creator>
				<category><![CDATA[网络技术]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://www.js8.in/?p=366</guid>
		<description><![CDATA[今天给爱墙做SEO优化，发现自己没有自定义404页面，并且还发现存在index of列目录的漏洞，后来才知道原来WordPress都没有在htaccess中使用Options -Indexes来防止列目录，于是先加上了Options -Indexes来防止列目录的问题，自动转为了404错误，而不是403<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="简单修改.htaccess来提高Yslow等级" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F471.html&from=http%3A%2F%2Fjs8.in%2F366.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10993517.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">简单修改.htaccess来提高Yslow等级</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用Apache htpasswd.exe来管理SVN帐户" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F518.html&from=http%3A%2F%2Fjs8.in%2F366.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10981581.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用Apache htpasswd.exe来管理SVN帐户</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="windows下安装基于Apache的SVN服务器" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F519.html&from=http%3A%2F%2Fjs8.in%2F366.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026284.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">windows下安装基于Apache的SVN服务器</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Javascript设置光标位置到结尾并显示出来" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F467.html&from=http%3A%2F%2Fjs8.in%2F366.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11027176.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Javascript设置光标位置到结尾并显示出来</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>今天给<a target="_blank" title="爱墙许愿" href="http://love.js8.in" target="_blank">爱墙</a>做SEO优化，发现自己没有自定义<strong>404</strong>页面，并且还发现存在index of列目录的漏洞，后来才知道原来WordPress都没有在htaccess中使用<strong>Options -Indexes</strong>来防止列目录，于是先加上了Options -Indexes来防止列目录的问题，自动转为了404错误，而不是403，呵呵~</p>
<p>可是我改变了<a target="_blank" title="爱墙许愿" href="http://love.js8.in" target="_blank">爱墙</a>的根目录下的htaccess配置把404页面指到了404.html，可是就是不能实现<strong>404页面</strong>的跳转呢？难道htaccess的404配置不可用？而是直接都返回到了<a target="_blank" title="爱墙许愿" href="http://love.js8.in" target="_blank">爱墙的首页</a>（http://love.js8.in）~这样子听说对<strong>SEO</strong>是很不好的，搜索引擎不会收录网站的首页，于是上网google原因，找了半天的原因也没有找到问题的根本所在~</p>
<p>后来我在一片不起眼的文章中找到了问题的所在~<br />
<span id="more-366"></span>文章写到如下内容<br />
<blockquote>Apache必须在所有上级的目录中查找<strong>.htaccess</strong>文件，以使所有有效的指令都起作用(参见指令的生效)，所以，如果请求/www/htdocs/example中的页面，Apache必须查找以下文件：<br />
　　/.htaccess<br />
　　/www/.htaccess<br />
　　/www/htdocs/.htaccess<br />
　　/www/htdocs/example/.htaccess<br />
　　总共要访问4个额外的文件，即使这些文件都不存在。(注意，这可能仅仅由于允许根目录&#8221;/&#8221;使用.htaccess ，虽然这种情况并不多。)</p></blockquote>
<p>我想是不是我的<strong>WordPress</strong>目录下的htaccess影响到了<a target="_blank" title="爱墙许愿" href="http://love.js8.in" target="_blank">爱墙</a>的htaccess呢？因为我的爱墙是放在WordPress目录下的，即WordPress/lovewall，WordPress的htaccess文件地址是WordPress/.htaccess，而<a target="_blank" title="爱墙许愿" href="http://love.js8.in" target="_blank">爱墙</a>的为WordPress/lovewall/.htaccess，所以二者是合并使用了，当访问其他页面的时候，会默认启用WordPress中的重写目录规则。我改写了一下WordPress根目录下的htaccess，果然如此~恍然大悟！可是怎么解决呢？？</p>
<p>开始想到的是吧lovewall文件夹从WordPress文件夹中移出来，这样WordPress的htaccess文件就不被引用了，可是这样还要重新配置lovewall中文件，还要重新解析http://love.js8.in，成本太高了，不喜欢~</p>
<p>后来，我仔细一想不是WordPress的htaccess的文件跟<a target="_blank" title="爱墙许愿" href="http://love.js8.in" target="_blank">爱墙</a>的htaccess文件都是合并吗？为什么不在爱墙的htaccess中把<strong>RewriteEngine</strong>关掉呢？于是我把爱墙的htaccess文件改成了如下的内容<br />
<blockquote>
RewriteEngine Off</p>
<p>ErrorDocument 404 /404.html<br />
ErrorDocument 403 /404.html<br />
Options -Indexes</p></blockquote>
<p>问题成功解决！<br />
<em>P.S.</em>:一、WordPress的htaccess默认存在<strong>列目录</strong>的问题，可以使用Options -Indexes解决这个问题；二、htaccess的引用是从跟文件夹的htaccess开始引用的，二者（或者更多）合并使用
<div class="copyright">
<strong>声明：</strong>文章未声明为原创文章，本文链接 <a href="http://js8.in/366.html" title="设置htaccess应该注意的问题">http://js8.in/366.html</a>. 转载请注明转自<a href="http://js8.in" title="前端开发博客"> JS8.IN ™</a></span></span></div>
<h3 class="box-title">随机文章</h3>
<ul class="box_random">
<li><a href="http://js8.in/413.html" title="jQuery1.4浏览器判断函数bug仍然存在" rel="bookmark inlinks">jQuery1.4浏览器判断函数bug仍然存在</a></li>
<li><a href="http://js8.in/19.html" title="学校DNS被人劫持啦！！！" rel="bookmark inlinks">学校DNS被人劫持啦！！！</a></li>
<li><a href="http://js8.in/497.html" title="韩峰其实是个好干部" rel="bookmark inlinks">韩峰其实是个好干部</a></li>
<li><a href="http://js8.in/537.html" title="承接企业网站建设，企业建站工作" rel="bookmark inlinks">承接企业网站建设，企业建站工作</a></li>
<li><a href="http://js8.in/554.html" title="引入CSS 的两种方式：link和@import的区别" rel="bookmark inlinks">引入CSS 的两种方式：link和@import的区别</a></li>
<li><a href="http://js8.in/391.html" title="Google2009年Logo大盘点——第一季" rel="bookmark inlinks">Google2009年Logo大盘点——第一季</a></li>
<li><a href="http://js8.in/6.html" title="经典QQ签名" rel="bookmark inlinks">经典QQ签名</a></li>
<li><a href="http://js8.in/678.html" title="转变代码思路：js浏览器判断方法" rel="bookmark inlinks">转变代码思路：js浏览器判断方法</a></li>
</ul>
<p style="margin:0;padding:0;height:1px;overflow:hidden;">
    <script type="text/javascript"><!--
        var wumiiSitePrefix = "http://js8.in";
        var wumiiEnableCustomPos = false;
        var wumiiParams = "&#038;num=4&#038;mode=3&#038;displayInFeed=1&#038;version=1.0.5.5&#038;pf=WordPress2.8.6";
    //--></script></p>
<hr />
<p><small>© 三水清 for <a href="http://js8.in">三水清</a>, 2009. |
<a href="http://js8.in/366.html#comments">2 comments</a> |在微博关注我：<a href="//weibo.com/sanshuiqing" target="_blank" title="关注断桥残雪的新浪微博">@清-三水清</a>
<br/>收藏到：
<a rel="nofollow" href="http://share.renren.com/share/buttonshare.do?link=%posturl%&title=%posttitle%" title="收藏本文到人人网" target="_blank">人人网</a> | <a rel="nofollow" href="http://www.douban.com/recommend/?url=%posturl%&title=%posttitle%" title="收藏本文到豆瓣" target="_blank">豆瓣</a> | <a rel="nofollow" href="http://www.kaixin001.com/repaste/share.php?rtitle=%posttitle%&rurl=%posturl%" title="收藏本文到开心网" target="_blank">开心网</a> | <a rel="nofollow" href="http://shuqian.qq.com/post?title=%posttitle%&%20uri=%posturl%" title="收藏本文到QQ书签" target="_blank">QQ书签</a> | <a rel="nofollow" href="http://v.t.sina.com.cn/share/share.php?url=%posturl%&title=%posttitle%" title="收藏本文到新浪微博" target="_blank">新浪微博</a> | <a rel="nofollow" href="http://v.t.qq.com/share/share.php?title=%posttitle%&url=%posturl%&site=http://www.kaixin100.info" title="收藏本文到腾讯微博" target="_blank">腾讯微博</a>
<br/>
Post tags: <a href="http://js8.in/tag/apache" rel="tag">Apache</a>, <a href="http://js8.in/tag/htaccess" rel="tag">htaccess</a><br/>
</small></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜你喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="简单修改.htaccess来提高Yslow等级" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F471.html&from=http%3A%2F%2Fjs8.in%2F366.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10993517.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">简单修改.htaccess来提高Yslow等级</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用Apache htpasswd.exe来管理SVN帐户" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F518.html&from=http%3A%2F%2Fjs8.in%2F366.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/17/10981581.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用Apache htpasswd.exe来管理SVN帐户</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="windows下安装基于Apache的SVN服务器" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F519.html&from=http%3A%2F%2Fjs8.in%2F366.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11026284.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">windows下安装基于Apache的SVN服务器</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Javascript设置光标位置到结尾并显示出来" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fjs8.in%2F467.html&from=http%3A%2F%2Fjs8.in%2F366.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/18/11027176.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Javascript设置光标位置到结尾并显示出来</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://js8.in/366.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

