简体   繁体   中英

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 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM