Support » Plugin: 404 Solution » Redirect to unregistered post types

  • Resolved mariusgmh

    (@mariusgmh)


    When hit with a 404 i get redirections to post types that are not in “Recognized Post Types” box but are quite relevant.
    I have set up only page and product types but i get redirects to static_block
    How do I correct this behavior. I do not want redirects to those post types

    link to image with relevant settings: https://i.imgur.com/mFH13Ks.png

    Also plug in logs Displayed 404 Page when i get shown a page in that post type.

    link to relevant image: https://i.imgur.com/N6fmV1T.png

Viewing 7 replies - 1 through 7 (of 7 total)
  • For the moment I fixed it with a htaccess redirect but I would like this investigated

    Plugin Author Aaron

    (@aaron13100)

    Hey mariusgmh,

    If the logs say it redirected to a 404 page then it probably did and something else is redirecting it afterward. To see the logs in a different way you can turn on debug logging (404 Solution -> Options -> Advanced Settings (Etc) -> Debug Logging). Check the box, scroll down and click Save Settings. Try the redirect again, then go back to the the “Debug Logging” setting and nearby click the “View” button to view the debug log. You could verify there or you could use pastebin to show me what it says it’s doing.

    Another way to see what post types 404 Solution will redirect to is on the Options page. At the very top, the option “Redirect all unhandled 404s to:” only shows pages that will be redirected to. So you can delete all text from that field to get a list of the posts/pages it will redirect to. It also lists the type.

    I tested with all you suggested and the debug said it acted correctly, Redirect all 404 also worked as promised so the issue seems to be something else. I did test with 2 plugins that I was thinking could affect things, Rank Math uninstalled and W3TotalCache disabled.

    From this I gather after this, the issue is somewhere else. Can you point me in the right direction to try and fix it?

    • This reply was modified 5 months, 3 weeks ago by mariusgmh.
    Plugin Author Aaron

    (@aaron13100)

    I would try disabling each plugin and retesting until it works as expected with one plugin disabled to see which one is causing the issue. I would start with 404 Solution to make sure it’s not causing the issue, and if it’s not then I would disable all plugins and test to make sure it is actually one of the plugins causing the issue and not a core part of WordPress.

    I did do it with those 2 plugins and the issue still occurred… Trouble is this happens on production. On local environment is fine but its not completely identical.

    Plugin Author Aaron

    (@aaron13100)

    Yes this was the issue.
    I was trying something else with another old plugin and it gave me something related to internal redirects
    wp-includes/class-wp-hook.php : 288 redirect_canonical
    wp-includes/canonical.php : 607 wp_redirect

    Thing is, the links are not cannonical…
    Consider this solved, this is not caused by your plugin.

    • This reply was modified 5 months, 3 weeks ago by mariusgmh.
Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.