0

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.

1

1 Answer 1

2

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.

2
  • What else does it do? I did a quick search and I couldn't find any documentation. 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
    Apr 23, 2013 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.