R
R
Roman Sarvarov2021-10-04 00:22:33
Nginx
Roman Sarvarov, 2021-10-04 00:22:33

How to remove GET parameter from URL (middirect)?

In short, for seo it is necessary that all pages with panning to the first page should not have a get parameter page.
For example:
site.ru/blog?blabla=123 - do nothing
site.ru/blog?blabla=123&page=1 - 301 to site.ru/blog?blabla=123
site.ru/blog?page=1&blabla=123 - 301 to site.ru/blog?blabla=123 site.ru/blog?blabla=123&page=2
- do nothing

Is it really possible to solve with nginx?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Karabanov, 2021-10-04
@megakor

Something like this:

if ($arg_page=1) {
  return 301 https://сайт.ру/blog?blabla=$arg_blabla;
}

Built-in variables
PS You can also experiment
with map : NGINX redirects for addresses with parameters via MAP

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question