Support » Plugin: Custom Permalinks » Redirecting to index.php instead of 404

  • We are using the Custom Permalinks plugin on our website (humancondition.com). We have an articles page (/freedom-essays) where we list articles from the “freedom-essays” category.

    When accessing /freedom-essays/article-slug-that-does-exist/ the post loads correctly, BUT, if we access a url like this:

    /freedom-essays/article-slug-which-does-not-exist/

    …the index.php file is loaded, which lists the recent posts that were created. Instead, we expect a 404 page to be loaded instead in this case.

    Is it possible to fix this ?

    Thanks very much for your time.

Viewing 15 replies - 1 through 15 (of 28 total)
  • Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    @platoscave Just do the following things.

    1. Change Permalinks to the “Plain” from the Permalinks Settings Page.
    2. Reset the permalink settings to as it was before following the point 1.
    3. If it doesn’t work then please check that your .htaccess file contains the default WordPress Rules. If not then please add them.

    Most probably these steps will resolve your issues.

    Regards,
    Sami

    Hi Sami, thank you very much for getting back to me I appreciate it. I have tried these steps and it hasn’t solved it. The .htaccess file definitely contains the default wordpress rules. Do you have any other ideas? Thank you very much for your time.

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    @platoscave Please try to deactivate all the plugins and then check the issue if the issue persist then please change the theme to the default WordPress theme.

    If the issue resolves after deactivating all the plugins then start activating the plugin one-by-one and check when the issue arises again.

    Thanks,
    Sami

    Platoscave

    (@platoscave)

    Hi Sami,

    I have turned all the other plugins off and I am still seeing the error.

    Could you advise something else to test?

    Thanks very much.

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    Hi @platoscave

    Please change your THEME to the default WordPress Theme and check on that.

    Regards,
    Sami

    Hi Sami,

    Thanks again for getting back to me and your help. I have tested on wordpress theme Twenty Seventeen and I am still seeing the issue.

    I really think there is something in the plugin that is redirecting to the index.php and not the 404 for some reason.

    Anyway, what should I try next?

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    @platoscave Don’t know what to say know. I am still not able to generate this on my end. You have already changed your theme to twenty seventeen and disabled all the plugins so now there is only one way i can suggest you to try is to check that your .htaccess file contains the correct WP setting or not.

    Just checm that foes it contains the the default WP configuration rules in it or not. If that’s correct then please let me know that how can i generate this issue on my end

    Regards,
    Sami

    Hi Sami,

    The following is included in my htaccess file:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    To reproduce on your end you can go to https://www.humancondition.com/freedom-essays/lkjl;kj

    Obviously, that url shouldn’t exist and should load the 404 page, but it doesn’t it loads the index.php

    Thanks Sami.

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    @platoscave LINK which you have provided is redirecting.

    https://www.humancondition.com/freedom-essays/lkjl;kj redirecting to : https://www.humancondition.com/freedom-essays/

    It looks fine to me. Can you confirm?

    Regards,
    Sami

    Hi Sami,

    Sorry no that’s not correct, I have a bit of js redirecting so the issue doesn’t appear to users. Please try https://staging.humancondition.com/freedom-essays/lkjl;kj

    Thanks very much.

    Hi Sami, Any update on this?. Thanks very much.

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    @platoscave No, there is no update as i am not able to debug it on my end.

    By the way, Freedom Essay is the custom PostType or a simple page? If it’s a custom PostType then how you created this PostType?

    Regards,
    Sami

    I’m not 100% sure what you are asking, but this is a Post using Single.php.

    The only change I have made is on the single.php file I have this code running so I can have two different templates based on a category:

    <?php
    if (in_category(‘141’)) {include (TEMPLATEPATH . ‘/single-141.php’);
    }
    else { include (TEMPLATEPATH . ‘/single-67.php’);
    }
    ?>

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    Please give it a try by removing this code from your single.php file.

    Thanks,
    Sami

    Thanks Sami, I have just tested this and the exact same behaviour occurs. The index.php comes up instead of the 404.

Viewing 15 replies - 1 through 15 (of 28 total)
  • You must be logged in to reply to this topic.