H
H
hiddenpm12019-02-03 17:45:18
htaccess
hiddenpm1, 2019-02-03 17:45:18

Remove get parameters from url on 301 redirect to another site?

You need to write a rule that would redirect from all category pages of the old site to a specific category of the new one, while discarding all get requests from the old site.
Now there is such a rule written in the htaccess of the old site
RewriteRule ^brands/ https://new-site.ru/manufacturers [L,R=301]
RewriteRule ^(.*)$ https://new-site.ru/ [L ,R=301]
it correctly redirects in this case: old-site.ru/brands/Sony to new-site.ru/manufactures,
but when requesting old-site.ru/brands/Sony?newprice, it turns out new-site.ru/ manufactures?newprice
you need to get new-site.ru/manufactures without a get request.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-02-03
@hiddenpm1

Just add a question mark.

RewriteRule ^brands/ https://new-site.ru/manufacturers? [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question