<?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; 路径</title>
	<atom:link href="http://ourapache.com/archives/tag/%e8%b7%af%e5%be%84/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>htaccess二级目录重写找不到路径</title>
		<link>http://ourapache.com/archives/316</link>
		<comments>http://ourapache.com/archives/316#comments</comments>
		<pubDate>Tue, 09 Mar 2010 01:36:35 +0000</pubDate>
		<dc:creator>OurApache</dc:creator>
				<category><![CDATA[Apache初级应用]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[路径]]></category>

		<guid isPermaLink="false">http://www.ourapache.com/?p=316</guid>
		<description><![CDATA[首先申明一下：使用.htaccess文件，会降低httpd服务器的一点性能.h]]></description>
			<content:encoded><![CDATA[<p>首先申明一下：使用.htaccess文件，会降低httpd服务器的一点性能.h<br />
我们一般会把客户的网站放在自己的网站的目录下面，<br />
比如FTP：/home/ftp/www，<br />
有一个网站http://www.example.com，<br />
那么新建一个网站的目录为http://www.example.com/newsite/，<br />
我们这个项目是使用qeephp开发的，使用<a href="http://www.qeephp.com/"><span style="color: #0059b3;">qeephp</span></a>的路由重写功能，在把网站上传到服务器上，<br />
使用了虚拟目录Alias，因为不想看到类似http://www.example.com/newsite/public/这样的路径，<br />
于是外部访问地址是http://www.example.com/newsite,<br />
在我启用了qeephp的rewrite时，一直说找不到路径，/home/ftp/www/newsite/,很奇怪。<br />
仔细阅读htaccess的文档，发现有一个BaseDir参数<br />
在htaccess 中添加</p>
<div class="wp_syntax" style="padding-bottom: 0px;">
<div class="code">
<pre class="ini" style="font-family: monospace;">RewriteEngine on
RewriteBase /twosisters
 
RewriteCond %<span>{</span>REQUEST_FILENAME<span>}</span> -s <span style="font-weight: bold; color: #000066;"><span style="color: #000066;"><span>[</span>OR<span>]</span></span></span>
RewriteCond %<span>{</span>REQUEST_FILENAME<span>}</span> -l <span style="font-weight: bold; color: #000066;"><span style="color: #000066;"><span>[</span>OR<span>]</span></span></span>
RewriteCond %<span>{</span>REQUEST_FILENAME<span>}</span> -d
RewriteRule ^.*$ - <span style="font-weight: bold; color: #000066;"><span style="color: #000066;"><span>[</span>NC,L<span>]</span></span></span>
RewriteRule ^.*$ index.php <span style="font-weight: bold; color: #000066;"><span style="color: #000066;"><span>[</span>NC,L<span>]</span></span></span></pre>
</div>
</div>
<p>问题就解决.<br />
估计把index.php改成绝对路径也没有问题。</p>
<h3  class="related_post_title">相关文章</h3><ul class="related_post"><li>2009年12月12号 -- <a href="http://ourapache.com/archives/310" title=".htaccess的301跳转">.htaccess的301跳转</a></li><li>2009年06月15号 -- <a href="http://ourapache.com/archives/259" title="16个简单实用的.htaccess小贴示">16个简单实用的.htaccess小贴示</a></li><li>2009年01月6号 -- <a href="http://ourapache.com/archives/32" title="htaccess学习笔记">htaccess学习笔记</a></li><li>2009年01月6号 -- <a href="http://ourapache.com/archives/25" title="Apache服务器使用.htaccess实现图片防盗链方法教程">Apache服务器使用.htaccess实现图片防盗链方法教程</a></li><li>2008年12月27号 -- <a href="http://ourapache.com/archives/7" title="apache中.htaccess的功能及写法">apache中.htaccess的功能及写法</a></li></ul>
	标签：<a href="http://ourapache.com/archives/category/primary" title="Apache初级应用" rel="tag">Apache初级应用</a>, <a href="http://ourapache.com/archives/tag/htaccess" title="htaccess" rel="tag">htaccess</a>, <a href="http://ourapache.com/archives/tag/%e8%b7%af%e5%be%84" title="路径" rel="tag">路径</a><br />
]]></content:encoded>
			<wfw:commentRss>http://ourapache.com/archives/316/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

