Answer the question
In order to leave comments, you need to log in
How to set up a redirect to 404 pages like site.eu/?hmb=654654?
Friends, I made a new site for the guys, when I connected Yandex.Webmaster and Metrica, I found out that in the search there are pages like site.ru/?hmb=Zapros-poiska
There were no such pages, so I suggested that the previous site was infected and the links were just redirected somewhere. Well, not the point.
Now the site is new, but these pages are in the search, and accordingly spoil all the statistics. I found in Yandex help how to remove pages from the search, but when deleting pages, they should refer to a 404 error. And since this is not a regular page, but some kind of request, then wordpress does not perceive it as a page not found on the server. How to be?
Answer the question
In order to leave comments, you need to log in
Something like this at the beginning of header.php of your template:
<?php
if(isset($_GET["hmb"])){
header('Location: /404/');
}
<?php
if(isset($_GET["hmb"])){
header("HTTP/1.0 404 Not Found");
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question