<?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>老余 &#187; apache</title>
	<atom:link href="http://laoyu.info/archives/tag/apache/feed" rel="self" type="application/rss+xml" />
	<link>http://laoyu.info</link>
	<description>Dreams are hard to follow,but dont let anyone tear them away!Hold on!</description>
	<lastBuildDate>Tue, 09 Feb 2010 07:55:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>折腾很久才搞定的一个Apache的Rewrite规则</title>
		<link>http://laoyu.info/archives/542.html</link>
		<comments>http://laoyu.info/archives/542.html#comments</comments>
		<pubDate>Sat, 25 Jul 2009 15:14:02 +0000</pubDate>
		<dc:creator>老余</dc:creator>
				<category><![CDATA[技术·学习]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[rewrite]]></category>

		<guid isPermaLink="false">http://laoyu.info/archives/542.html</guid>
		<description><![CDATA[今天碰到了一个Apache的重写url的问题,需求是这样的,把
 
/abc/hello.html?page=2 
rewrite成 
/search.php?key=hello&#38;page=2
我自己尝试写规则如下
^abc/(.+)\.html\?page=([0-9]+)$ /search.php/?key=$1&#38;page=$2
这个规则怎么尝试都无法成功,就是不能匹配上那个问号.
实在搞不定只好利用网络请教高手了,记录过程如下
1.先到我加的几个qq群里问,自认为这种方式较快,因为这些qq群在线都是好几十人,随便碰到个会的就帮我搞定了.结果让我很失望,发了4个qq群,只有一个群里得到了答复,而且答案跟我的写法一样.
2.到百度知道提问,一个小时后得到一个答复跟我自己写的一样,仍然没搞定.
3.到国内一个很大的论坛发贴求助,只有一个人答复 &#34;你悬偿点分嘛..重赏之下,必有勇夫&#34;,我以为帮助别人即使没有所谓的&#34;分&#34;也很快乐.
4.转战国外论坛,在webmasterworld以interrogation rewrite 为关键字搜索到了www.webmasterworld.com/apache/3375528.htm,虽然没有找到我要的答案,但是知道了apache的rewrite有个叫query_string的东西
5.在百度以关键词query string rewrite搜索到了我想要的结果http://stauren.net/log/4b8atjdnw.html 说白了就是一个参数的问题那就是[L,QSA]
摘抄一段那位网友的文章



&#60;IfModule mod_rewrite.c&#62;


&#160; RewriteEngine on


&#160; # Rewrite current-style URLs of the form &#39;index.php?q=x&#39;.


&#160; RewriteCond %&#123;REQUEST_FILENAME&#125; !-f


&#160; RewriteCond %&#123;REQUEST_FILENAME&#125; !-d


&#160; RewriteRule ^&#40;.*&#41;$ index.php?q=$1 &#91;L,QSA&#93;


&#60;/IfModule&#62;



第1行： 如果服务器加载了rewrite模块，则执行如下规则
第2行： 打开改写引擎，不用动，加上就好。
第3行： 注释
第4行： RewriteCond 表示这是应用改写规则的条件，%{REQUEST_FILENAME}表示对请求的文件完整url进行判断，-f是表示这是普通文件，!表示非。这句的意思就是，如果请求的不是普通文件，则对url进行改写。
第5行： 基本同第4行，-d的意思是文件夹
第 6行：RewriteRule 表示这是改写规则，^(.*)$是一个正则，表示整个请求的url（在RewriteBase 之后的），index.php?q=$1是改写的样式。这里可能需要对正则熟一点才能看懂了。最后的[L,QSA]是flag，标志。L表示是last，针对这个url的最后一次改写，不再应用其他rule，QSA表示query string append，将查询字串加入原有查询字串之后。

一点感慨,国内的论坛交流分享的氛围远远不及国外的论坛,看看webmasterworld的回帖基本上就是一篇文章.

想到了一个小笑话:
一日早朝，王安石出列：“臣有奏，OOXX（以下省略1万字）。”刚说完身后跪下一片叫到:“臣沙发”“臣板凳”“臣地板”“臣顶”“臣也顶”……最后几人面带笑容不语，神宗见状怒击龙椅:“不许纯表情回帖。”
相关文章

2009-07-21AIX 5.3下安装apache 2.2.11详细步骤 (0)

]]></description>
		<wfw:commentRss>http://laoyu.info/archives/542.html/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>AIX 5.3下安装apache 2.2.11详细步骤</title>
		<link>http://laoyu.info/archives/535.html</link>
		<comments>http://laoyu.info/archives/535.html#comments</comments>
		<pubDate>Tue, 21 Jul 2009 06:33:00 +0000</pubDate>
		<dc:creator>老余</dc:creator>
				<category><![CDATA[技术·学习]]></category>
		<category><![CDATA[AIX]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[weblogic]]></category>

		<guid isPermaLink="false">http://laoyu.info/archives/535.html</guid>
		<description><![CDATA[weblogic的端口默认是7001,应用的访问路径通常是http://192.168.1.1:7001/XXXWeb,显然这种路径对用户来说太复杂,weblogic可以修改启动的端口,如80,这样上面的路径就变为http://192.168.1.1/XXXWeb,仍然不够简洁,而且如果weblogic不是用root来启动的,就不能修改端口为80(*NIX系统1024以下的端口只能是root用户绑定),后台会提示80端口已经被占用,无法启动weblogic服务器.     
一个折衷的办法是用root来启动apache并绑定80端口,来做前端服务器,负责转发请求.   
我的环境是IBM p570 aix 5.3,我安装的步骤如下&#8230;   
1.安装GCC 
（1）从IBM上下载   gcc-4.0.0-1.aix5.3.ppc.rpm，   gcc-cplusplus-4.0.0-1.aix5.3.ppc.rpm，   libgcc-4.0.0-1.aix5.3.ppc.rpm，   libstdcplusplus-4.0.0-1.aix5.3.ppc.rpm，   libstdcplusplus-devel-4.0.0-1.aix5.3.ppc.rpm   地址为http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/rpmgroups.html      为了方便大家,我把rpm的实际地址放上来  ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/gcc/gcc-4.2.0-3.aix5.3.ppc.rpm   ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/gcc/gcc-cplusplus-4.2.0-3.aix5.3.ppc.rpm   ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/gcc/libstdcplusplus-devel-4.2.0-3.aix5.3.ppc.rpm   ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/gcc/libstdcplusplus-4.2.0-3.aix5.3.ppc.rpm   ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/gcc/libgcc-4.2.0-3.aix5.3.ppc.rpm  [...]]]></description>
		<wfw:commentRss>http://laoyu.info/archives/535.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
