A
A
Andrey2016-07-04 11:03:43
CMS
Andrey, 2016-07-04 11:03:43

How to set up a 301 redirect from site.ru/?page=16838683870?

Hello!

Tell me how to set up a 301 redirect template to the main page from the pages:

  • site.ru/?page=16838683870
  • site.ru/?page=4qe6dbjkxdk
  • site.ru/?page=8gggj2wr1i
  • site.ru/?page=81332493384


Tried /?page=* , but redirect doesn't work like that, pages open.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Dmitriev, 2016-07-14
@MrDmives

In Apache , we simply add the following lines at the root to the htaccess file:
Redirect 301
site.ru/?page=16838683870
site.ru
Redirect 301 site.ru/?page=81332493384 site.ru
And for nginx I found this feature: winginx.com/ru/htaccess
Result , code for nginx:
# nginx configuration
location site.ru/?page=16838683870 {
rewrite ^(. *)$ site.ru redirect;
}
location site.ru/?page=4qe6dbjkxdk {
rewrite ^(.*)$ site.ru redirect;
}
location site.ru/?page=8gggj2wr1i {
rewrite ^(.*)$ site.ru redirect;
}
location site.ru/?page=81332493384 {
rewrite ^(.*)$ site.ru redirect;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question