G
G
glem13372018-11-13 11:05:32
htaccess
glem1337, 2018-11-13 11:05:32

Why does 301 redirect with parameters not work?

RewriteCond %{QUERY_STRING} ^nomer=370$ [NC]
RewriteRule ^production\.php$ /? [R=301,L]

Should redirect /production.php?nomer=370 to the main page. I noticed that if you put index instead of production, then everything is OK, the redirect works.
What could be wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2018-11-13
@shambler81

In general, everything is written correctly, if you only have several get parameters, try to clarify like this

RewriteCond %{QUERY_STRING} (^|&)nomer\=370($|&)
RewriteRule ^production\.php$ /? [L,R=301]

But then again, you seem to be fine.
In what part of .htaccess is it usually not under CNC?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question