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.
精彩评论