Answer the question
In order to leave comments, you need to log in
When entering a site at the end, you enter any number and the content is pulled up according to the end number, instead of 404. How to fix it?
Good evening!
Tell me, the site is on the Wordpress engine.
So I noticed that:
you enter any number at the end. And according to the idea, it should be 404. (since there is no such content at the address)
But the redirect is pulled up and the content is displayed according to the end number.
Example:
site.ru/1
Then redirect and
site.ru/wp-content/uploads/2018/10/1.jpg
Tell me
how to fix it?!
Answer the question
In order to leave comments, you need to log in
Try writing this in functions.php:
function remove_redirect_guess_404_permalink( $redirect_url ) {
if ( is_404() && !isset($_GET['p']) )
return false;
return $redirect_url;
}
add_filter( 'redirect_canonical', 'remove_redirect_guess_404_permalink' );
You need to look in the 404.php file of the theme or try to reinstall the WordPress files (without touching the database). Although it is not an exception that the problem may be in the browser (you can try to launch the site on another browser, if the redirect remains - the problem is in the site, if the redirect has disappeared - the problem is in the browser data).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question