I am using the following URL:
http://hostname/Numark-iDJ-Live-DJ-software-controller-for-iPad-iPhone-or-iPod/product/?mid=1&pid=B004JPPO94&src=hmb_numark
(also, the 'Numark.. to ipod..' is the 'title')
I want to write a rule to redirect this URL to the following URL
http://hostname/product/?sid=1&pid=B004JPPO94&title=Numark-iDJ-Live-DJ开发者_开发百科-software-controller-for-iPad-iPhone-or-iPod&src=hmb_numark
note the first url contains mid and pid while the second contains pid and sid.
Can someone please help me out and direct me towards the rewrite rule that would work for this case?
Thank You.
Old URL:
http://hostname/Numark-iDJ-Live-DJ-software-controller-for-iPad-iPhone-or-iPod/product/?mid=1&pid=B004JPPO94&src=hmb_numark
New URL:
http://hostname/product/?sid=1&pid=B004JPPO94&title=Numark-iDJ-Live-DJ-software-controller-for-iPad-iPhone-or-iPod&src=hmb_numark
I have no idea if that's what you actually want as you haven't fully specified the question. This rule also expects that mid, pid and src are all present in the URL and in the given order.
RewriteEngine On
RewriteCond %{QUERY_STRING} mid=(.*)&pid=(.*)&src=(.*)
RewriteRule (.*)/product/ product/?sid=%1&pid=%2&title=$1&src=%3 [R=301,L]
精彩评论