I notice that if I type in http://www.example.com/pag
I can land on an existing page that has a name like http://www.example.com/page_five
. I don't know exactly what causes this, but I want to know if there is a way to stop it from happening.
-
duplicate question– MiloCommented Apr 23, 2013 at 14:54
Add a comment
|
1 Answer
This happens in redirect_canonical()
.
You can disable that function with:
remove_action('template_redirect', 'redirect_canonical');
But be aware it does a lot more. Too much for my taste …
So there might be side effects.
-
What else does it do? I did a quick search and I couldn't find any documentation. Commented Apr 23, 2013 at 14:55
-
@Emerson I made an update to my answer and added a link to the function’s source code. It is really, really long.– fuxia ♦Commented Apr 23, 2013 at 14:58