• Resolved fozdemir

    (@fozdemir)


    Hello,

    This plugin redirects a custom post-type page to the same page and creates a redirection loop.

    This page (/brand-category/travel-holiday-deals/travel-esim-deals/) has been auto-redirected to this page (/brand-category/travel-holiday-deals/travel-esim-deals/). I have even tried to delete this redirection manually. Every time I visit the page, it keeps redirecting it again. I can’t fix this issue.

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Aaron

    (@aaron13100)

    Hey fozdemir,

    Your message is a bit unclear because the two URLs you’ve included are the same (/brand-category/travel-holiday-deals/travel-esim-deals/). So I’m not sure what kind of redirection or loop is happening.

    The main point of the answer:

    If you want 404 Solution to not redirect from a non-existent page to a 404 error or to any other page, then you can create a custom redirect for that URL. In the redirect, choose the destination you want (a 404 page or a different page). If you move the redirect to the trash then the 404 may be redirected automatically anyway, if in your settings you have the “Create automatic redirects” checkbox checked (it’s the second option on the Options page for 404 Solution).

    Other details:

    I did create a custom post type and do some testing and I found the following.

    • The 404 Solution plugin does redirect from a custom post type URL to a different URL. This happens because the custom post type URL is not a page, and therefore causes a 404 error. Note that the plugin only redirects when a 404 error is found – it does not redirect otherwise.
    • I deactivated the plugin and changed the slug of the destination page (the one that was being redirected to) and even with the plugin deactivated and the new slug, WordPress still redirected me from the custom post type slug to the destination page just like before. This means that WordPress itself and not the plugin is redirecting to that page for some reason. I don’t know if this covers your situation because I don’t have the details of what kind of redirection is happening for you, but if you deactivate the 404 Solution plugin, clear your browser cache, and try again then you can see if the redirection still occurs, in which case it’s WordPress (or a different plugin) that’s redirecting you and not the 404 Solution plugin.
    • After moving the destination page to the trash and with the 404 Solution plugin deactivated, I was able to get a 404 error when visiting the custom post type URL.

    To summarize, without more specific information I can only guess at what’s happening. Also, there may be redirection that happening due to WordPress itself, and not due to the plugin. 404 Solution only redirects if a page does NOT exist and a URL causes a 404 error. So for it to redirect from a custom post type URL it means that URL is causing a 404.

    Please note that custom post types are not like categories, e.g website.com/category/category-name/ automatically has a page in WordPress and does not cause a 404 error – it lists the pages in that category. A custom post type is not the same. When you go to website.com/custom-post-type/ it causes a 404 error.

    The 404 Solution plugin redirects 404 errors based on the URL and especially the last part of a URL. Therefore, if there is a page or post with the slug “travel-esim-deals” or anything similar to the slug of the custom post type, 404 Solution will redirect from the custom post type to that page. My guess is that what you want to happen is for the site to list the posts in the custom post type. I couldn’t find a plugin that does that – all of the examples I found involved adding custom files and PHP code.

    Let me know if you need more clarification or want to provide more details.

    thanks

    • This reply was modified 11 months, 4 weeks ago by Aaron.
    • This reply was modified 11 months, 4 weeks ago by Aaron.
    Plugin Author Aaron

    (@aaron13100)

    Hopefully you figured this out.

    Thread Starter fozdemir

    (@fozdemir)

    Hello, sorry for the late reply. It also doesn’t make sense to me why it redirects itself to the same page. However, I found the problem. Pages with subcategories selected are automatically redirected to 404 (even if the page exists) – (Permalinks are saved in the WP Settings section)

    ACF Taxonomy Name: Brand Category

    ACF Taxonomy Name: Travel Holiday Deals

    ACF Sub-Category under Travel Holiday Deals Taxonomy: Travel Esim Deals.

    So, there is no issue if I don’t select a sub-category for the hierarchy.

    This works: /brand-category/travel-esim-deals/

    This works: /brand-category/travel-holiday-deals/

    This doesn’t work: /brand-category/travel-holiday-deals/travel-esim-deals/

    I hope I explained myself clearly.

    Thank you.

    Plugin Author Aaron

    (@aaron13100)

    Actually I still don’t understand. If you want to give me more details you can. e.g. the specific plugin you’re using, the page you go to when the issue happens, the expected resulting page, the actual page that you end up at. Also you can turn on debug logging to see what 404 Solution is doing. On the options page under Advanced Settings Etc there’s a checkbox for debug logging. Check that then click Save at the bottom. After you reproduce the issue you can paste the last 3 pages (for example) of the debug log to pastebin.com and share the link here. (If you like.)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Auto redirection to already existing page’ is closed to new replies.