开发者

HTAccess Rule for Rewrite URL

I have url

domainname.com/filename.php?id=45&view=sale

i want to set url as

domainname.com/filename/id/45/view/sale/

Can any 开发者_JAVA百科one please help.

thanks


RewriteEngine On
RewriteCond %{QUERY_STRING} id=(.*)&view=(.*)
RewriteRule ^(.*).php$ /$1/id/%1/view/%2 [R]

You do want to map this way, right? The other way round is easier. You may remove the [R] flag. It helps testing.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜