标签归档:重写规则

搞定了两个无聊的Apache URL Rewrite

http://blog.yimeng.ch/read.php?490

http://blog.yimeng.ch/read.php/238.htm

Rewrite:

http://blog.yimeng.ch/?p=490

http://blog.yimeng.ch/?p=238

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{query_string} [0-9]+
RewriteRule ^read\.php$ /blog/?p=%{query_string} [R=301,L]
RewriteRule ^read\.php/([0-9]+)\.htm$ /blog/?p=$1 [R=301,L]
</IfModule>

继续阅读