L
L
Leonid Nimchenko2019-05-13 19:37:20
htaccess
Leonid Nimchenko, 2019-05-13 19:37:20

Why doesn't this RewriteRule work?

Hello.
There is a request:
https://www.test.ru/zaschita-drevesiny/?filter_bra...
There is a rule:
RewriteRule ^([^.]+)/\?(filter.*)$ index.php?do=cat&category =$1&$2 [L]
It does not work for some reason, but the following one works after it:
RewriteRule ^([^.]+)/?$ index.php?do=cat&category=$1 [L]
Please tell me where the error is ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dodo512, 2019-05-13
@dodo512

GET parameters should be looked for in %{QUERY_STRING}.

RewriteCond %{QUERY_STRING} ^filter
RewriteRule ^([^.]+)$ index.php?do=cat&category=$1 [L,QSA]

V
Viktor Taran, 2019-05-14
@shambler81

here is happiness for you
https://donatstudios.com/RewriteRule_Generator

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question