• I’m trying to work out the flow of URL resolution from the initial entry in the index page through to a 404. All documentation is about what to do after WP gives up and is about to throw a 404, then we get into redirection, etc.

    But it looks like WP will invoke a hook to handle a 404, for example, when it doesn’t find a page at a path like /category/foo. Sure it needs to generate that page as an archive, but it’s doing something before that which then gets picked up as a requirement for redirection. The result is that when I’m using common redirection plugins, some valid requests are getting passed off to redirection when WP would otherwise process them if the plugins don’t subscribe to hooks. (Yeah, “which hooks?” … I’m getting into that now to see what they’re doing, and with info from this thread I’m hoping to get a better idea of what they should be doing.

    I’ll be happy to look at code if someone can just point me to the code that loops through a URL, successively passing it down for further resolution.

    Thanks!

    • This topic was modified 7 years, 8 months ago by Tony G.
Viewing 1 replies (of 1 total)
  • Hello,

    Do you want a custom 404 page?
    In the theme directory is a 404.php, you can look at that.
    i did replace al 404 errors to the home page, with this code:

    <?php
    header("HTTP/1.1 301 Moved Permanently");
    header("Location: ".get_bloginfo('url'));
    exit();
    ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Need info on WP URL resolution’ is closed to new replies.