开发者

HTAccess Rule for Rewrite URL

开发者 https://www.devze.com 2023-03-11 22:56 出处:网络
I have url domainname.com/filename.php?id=45&view=sale i want to set url as domainname.com/filename/id/45/view/sale/

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

精彩评论

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