Htaccess重写规则 - 获取方法

时间:2015-07-01 18:50:00

标签: apache .htaccess mod-rewrite url-rewriting

嗨我有另一个问题,我想改写:

http://example.com/articles/page/idhttp://example.com/?rt=articles&pageis=id

我的代码:

RewriteEngine on
Options -Indexes

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

RewriteRule ^articles/page/(.+)$ index.php?rt=articles&pageis=$1 [NC,L,QSA]

RewriteRule ^articles/(.+)$ index.php?rt=articles&title=$1 [NC,L,QSA]

RewriteRule ^page/(.+)$ index.php?page=$1 [NC,L,QSA]

RewriteRule ^(.*)$ index.php?rt=$1 [L,QSA]

First RewriteRule无效,其他则完美无缺。有人能帮助我吗? 这可以用这种方式重写吗?

0 个答案:

没有答案