0

I want to rewrite my URL below

https://xxx.xxx/159/prepared-is-me-marianne-pleasure-likewise-debating-wonder?show=199

to become like this

https://xxx.xxx/159/prepared-is-me-marianne-pleasure-likewise-debating-wonder/show/199

My current rewrite is this

RewriteRule ^/(.*)/(.*)?show=(.*)$ /$1/$2/show/$3 [L]

But it does not to work.

as I test here my rule http://htaccess.mwl.be/ it says the my rule doesn't meet the condition of the input URL

Netorica
  • 18,523
  • 17
  • 73
  • 108
  • You're saying you want A to B but your rule is trying B to A. Also, "seems not to work" doesn't tell me what your problem is. You should write the output you get and what you expect – pmmaga Oct 19 '16 at 13:54
  • @pmmaga I cleared out my rule sorry – Netorica Oct 19 '16 at 13:59
  • Better! But I still don't know which result you're getting. – pmmaga Oct 19 '16 at 14:01
  • @pmmaga well i test here my rule http://htaccess.mwl.be/ but it seems to say that the condition doesn't meet on the input URL. I thinking i'm incorrect on the regex – Netorica Oct 19 '16 at 14:03
  • Possible duplicate of [How can I match query string variables with mod\_rewrite?](http://stackoverflow.com/questions/2252238/how-can-i-match-query-string-variables-with-mod-rewrite) – pmmaga Oct 19 '16 at 15:00

2 Answers2

0

I usually use http://www.generateit.net/mod-rewrite/index.php to create my rewriting rules, hope it help !

ayyyymtl
  • 13
  • 7
0

As explained on this previous question, RewriteRules do not take the querystring into account, only the actual path. So your ?show= part of your original URL will never be matched.

Community
  • 1
  • 1
pmmaga
  • 410
  • 7
  • 18