<?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>Yousri&#039;s Blog &#187; htaccess</title>
	<atom:link href="http://blog.yousri.org/tag/htaccess/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.yousri.org</link>
	<description>一个人骑单车在陌生城市路上自由穿梭的生活</description>
	<lastBuildDate>Fri, 20 Jan 2012 15:01:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Dokuwiki重写URL配置</title>
		<link>http://blog.yousri.org/2009/05/27/dokuwiki%e9%87%8d%e5%86%99url%e9%85%8d%e7%bd%ae.html</link>
		<comments>http://blog.yousri.org/2009/05/27/dokuwiki%e9%87%8d%e5%86%99url%e9%85%8d%e7%bd%ae.html#comments</comments>
		<pubDate>Wed, 27 May 2009 15:28:03 +0000</pubDate>
		<dc:creator>Yousri</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[dokuwiki]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[URL重写]]></category>

		<guid isPermaLink="false">http://qingxianyan.cn/?p=334</guid>
		<description><![CDATA[默认情况下，DokuWiki不做任何的URL重写，它的原始URL是这样的：1. http://wiki.qingxianyan.cn/doku.php?id=page这样默认的URL不利于有些搜索引擎不收录，而且也不易于记忆 通过设置DokuWiki的配置设置里面的高级设置的userwrite配置选项它可以支持两种URL重写方法：&#160;&#160;&#160;&#160;&#160; 一个是利用服务器的mod_rewrite，&#160;&#160;&#160;&#160;&#160; 另一个是在DokuWiki内部自己处理URL重写。下面是userewrite选项值的列表及其对应的URL格式：&#160;&#160;&#160;&#160;&#160; 1、默认值没有URL重写 http://wiki.qingxianyan.cn/doku.php?id=wiki:syntax&#160;&#160;&#160;&#160;&#160; 2、htaccess服务器处理 http://wiki.qingxianyan.cn/wiki:syntax&#160;&#160;&#160;&#160;&#160; 3、DokuWiki处理 http://wiki.qingxianyan.cn/doku.php/wiki:syntax使用服务器处理　　先在/wiki/conf/dokuwiki.php中设置：&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $conf['userewrite'] = 1; Apache服务器开启Rewrite功能 　　apache的URL重写是使用mod_rewrite模块。在apache的配置文件中添加如下这行： LoadModule rewrite_module modules/mod_rewrite.so 　　然后使用mod_rewrte的指令来配置URL重写规则。这些规则可以放在apache的全局配置文件内，也可以放在DokuWiki的根目录下的.htaccess文件内，事实上DokuWiki已经为了写好了这些规则放在.htaccess.dist中，修改删除部分“#”注释即可 内容如下： RewriteEngine on RewriteBase /dokuwiki RewriteRule ^_media/(.*) lib/exe/fetch.php?media=$1 [QSA,L] RewriteRule ^_detail/(.*) lib/exe/detail.php?media=$1 [QSA,L] RewriteRule ^_export/([^/]+)/(.*) doku.php?do=export_$1&#38;id=$2 [QSA,L] RewriteRule ^$ doku.php [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) doku.php?id=$1 [QSA,L] 　　在RewriteBase /dokuwiki这一行，你需要根据实际情况做修改成指向你的DokuWiki目录的路径，Dokuwik就在站点根目录或者已经使用子域名解析到相应目录时，需将.htaccess 文件中的 RewriteBase <a href='http://blog.yousri.org/2009/05/27/dokuwiki%e9%87%8d%e5%86%99url%e9%85%8d%e7%bd%ae.html'>[...]</a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2010%2F05%2F15%2Fhow-to-upgrade-dokuwiki.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F05%2F27%2Fdokuwiki%25E9%2587%258D%25E5%2586%2599url%25E9%2585%258D%25E7%25BD%25AE.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">相对靠谱的Dokuwiki升级方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2010%2F02%2F25%2Finstall_apache_and_subversion.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F05%2F27%2Fdokuwiki%25E9%2587%258D%25E5%2586%2599url%25E9%2585%258D%25E7%25BD%25AE.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache编译安装配置并支持Subversion版本控制</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F19%2F%25E5%258A%25A0%25E5%25BC%25BAapache%25E9%2585%258D%25E7%25BD%25AE%25E7%259A%2584%25E5%25AE%2589%25E5%2585%25A8%25E6%2596%25B9%25E6%25B3%2595%25E3%2580%2590%25E8%25BD%25AC%25E3%2580%2591.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F05%2F27%2Fdokuwiki%25E9%2587%258D%25E5%2586%2599url%25E9%2585%258D%25E7%25BD%25AE.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">加强Apache配置的安全方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F12%2Fapache%25E6%25BD%259C%25E5%259C%25A8%25E6%25BC%258F%25E6%25B4%259E.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F05%2F27%2Fdokuwiki%25E9%2587%258D%25E5%2586%2599url%25E9%2585%258D%25E7%25BD%25AE.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache潜在漏洞</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" 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>默认情况下，DokuWiki不做任何的URL重写，它的原始URL是这样的：<br />1. http://wiki.qingxianyan.cn/doku.php?id=page<br />这样默认的URL不利于有些搜索引擎不收录，而且也不易于记忆<br />
通过设置DokuWiki的配置设置里面的高级设置的userwrite配置选项它可以支持两种URL重写方法：<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 一个是利用服务器的mod_rewrite，<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 另一个是在DokuWiki内部自己处理URL重写。<br />下面是userewrite选项值的列表及其对应的URL格式：<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1、默认值没有URL重写 http://wiki.qingxianyan.cn/doku.php?id=wiki:syntax<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2、htaccess服务器处理 http://wiki.qingxianyan.cn/wiki:syntax<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3、DokuWiki处理 http://wiki.qingxianyan.cn/doku.php/wiki:syntax<br />使用服务器处理<br />　　先在/wiki/conf/dokuwiki.php中设置：<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $conf['userewrite'] = 1;<br />
Apache服务器开启Rewrite功能<br />
　　apache的URL重写是使用mod_rewrite模块。在apache的配置文件中添加如下这行：</p>
<pre lang="apache">LoadModule rewrite_module modules/mod_rewrite.so</pre>
<p>　　然后使用mod_rewrte的指令来配置URL重写规则。这些规则可以放在apache的全局配置文件内，也可以放在DokuWiki的根目录下的.htaccess文件内，事实上DokuWiki已经为了写好了这些规则放在.htaccess.dist中，修改删除部分“#”注释即可  内容如下：</p>
<pre lang="apache">
      RewriteEngine on
      RewriteBase /dokuwiki
      RewriteRule ^_media/(.*)              lib/exe/fetch.php?media=$1  [QSA,L]
      RewriteRule ^_detail/(.*)             lib/exe/detail.php?media=$1  [QSA,L]
      RewriteRule ^_export/([^/]+)/(.*)     doku.php?do=export_$1&amp;id=$2  [QSA,L]
      RewriteRule ^$                        doku.php  [L]
      RewriteCond %{REQUEST_FILENAME}       !-f
      RewriteCond %{REQUEST_FILENAME}       !-d
      RewriteRule (.*)                      doku.php?id=$1  [QSA,L]
</pre>
<p>　　在RewriteBase /dokuwiki这一行，你需要根据实际情况做修改成指向你的DokuWiki目录的路径，Dokuwik就在站点根目录或者已经使用子域名解析到相应目录时，需将.htaccess 文件中的 RewriteBase /dokuwiki 行使用首字符“#”将其注释</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2010%2F05%2F15%2Fhow-to-upgrade-dokuwiki.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F05%2F27%2Fdokuwiki%25E9%2587%258D%25E5%2586%2599url%25E9%2585%258D%25E7%25BD%25AE.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">相对靠谱的Dokuwiki升级方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2010%2F02%2F25%2Finstall_apache_and_subversion.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F05%2F27%2Fdokuwiki%25E9%2587%258D%25E5%2586%2599url%25E9%2585%258D%25E7%25BD%25AE.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache编译安装配置并支持Subversion版本控制</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F19%2F%25E5%258A%25A0%25E5%25BC%25BAapache%25E9%2585%258D%25E7%25BD%25AE%25E7%259A%2584%25E5%25AE%2589%25E5%2585%25A8%25E6%2596%25B9%25E6%25B3%2595%25E3%2580%2590%25E8%25BD%25AC%25E3%2580%2591.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F05%2F27%2Fdokuwiki%25E9%2587%258D%25E5%2586%2599url%25E9%2585%258D%25E7%25BD%25AE.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">加强Apache配置的安全方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F12%2Fapache%25E6%25BD%259C%25E5%259C%25A8%25E6%25BC%258F%25E6%25B4%259E.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F05%2F27%2Fdokuwiki%25E9%2587%258D%25E5%2586%2599url%25E9%2585%258D%25E7%25BD%25AE.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache潜在漏洞</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" 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://blog.yousri.org/2009/05/27/dokuwiki%e9%87%8d%e5%86%99url%e9%85%8d%e7%bd%ae.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

