apache - Rewriting query string using mod_rewrite -
itemprop = "text">
In my MVC application, I determine which controller and verb it uses to remove the parameter from Yuri with the Yuri Router is. I have written it so that it can accept both forms:
http: // localhost / controller / action / param1name / param1value http: // localhost / controller / action? Param1name = param1value / p / v
at ? Now what I want to do to redirect the form P = v
form is to use Mod_rewrite form (Logic is purely cosmetic, use the ? X = y
form in GET forms) . I'm totally stuck with this how I can do it - I have an idea, I need to use the $ {QUERY_STRING}
, but I'm not sure how.
If you actually have / controller / action? Try it:
Rewrite% {THE_REQUEST} ^ GET \ / [^ / 2] From Param1Name = param1Value
to / controller / action / param1Name / param1Value
] + / [^ /] + \? [^ \ S] + RewriteCond% {QUERY_STRING} ^ ([^ = & amp; nbsp; +) = ([^ & amp;; +) & amp;; (. *) Recharge rules ^ [^ /] + / [^ /] +. * / $ 0 /% 1 /% 2?% 3 [N] Rewrite condom% {THE_REQUEST} ^ GET \ / [^ /] + / [^ /] + \? [^ \ S] + rewrite rule ^ [^ /] + / [If you want in the opposite direction:
RewriteRule ^ ([^ / ^]. * / $ 0 [L, R = 301]
] + / [^ /] +) / ([^ /] +) / ([^ /] +) (/.*) $ 1 $ 4? $ 2 = $ 3 [QSA]
Comments
Post a Comment