一个URL具有多个GET变量mod-rewrite规则多个、变量、规则、rewrite

由网友(\别把自己整得跟个笑话)分享简介:林新URL重写,即时通讯能够建立简单的规则,但无法建立一个URL由多个获得变量的规则Im new to url rewriting, Im able to build simple rules but unable to build a rule for a url consisting of multiple ge...

林新URL重写,即时通讯能够建立简单的规则,但无法建立一个URL由多个获得变量的规则

Im new to url rewriting, Im able to build simple rules but unable to build a rule for a url consisting of multiple get variables

我的网址是: 的http://www.mywebsite.com/index.php?AKey=fjdsakfd&uid=2&cl=Election&req=Voters

我想要一个干净的网址,如: http://www.mywebsite.com/voters

请帮我建立正确的重写规则为上面的'洁净的URL

Kindly help me in building the correct rewrite rule for the above 'clean url'

推荐答案

将这个code在 DOCUMENT_ROOT /的.htaccess 文件:

Put this code in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On

RewriteRule ^voters/?$ /index.php?AKey=fjdsakfd&uid=2&cl=Election&req=Voters [L,QSA,NC]

编辑:基于评论:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/?$ /index.php?cl=$1&req=$2 [L,QSA]
阅读全文

相关推荐

最新文章