• Alright, I am trying to create a 404 Error for a page of mine but it is automatically redirecting to a different page. The best way to show you what I mean is through an example.

    Let’s say I have this page:

    https://www.domain.com/this-is-my-page

    And let’s say that you type in:

    https://www.domain.com/this-is-my

    It will automatically redirect to the domain.com/this-is-my-page instead of showing a 404 page. Is there anyway to actually force a 404 page to show when this happens?

    I know this is a strange question, and you’re probably thinking “why would you want to do that” but that’s besides the point. Does anyone know how to do this?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Can you post your site URL?

    Thread Starter bsean23

    (@bsean23)

    Krishna, sorry, I cannot do that here.

    After looking out there some more, I think this has to do with the wp_rewrite_rules.

    Just to reiterate…

    If I had a page that said domain.com/today-is-monday-finally/ and only typed in domain.com/today-is-monday/ (which doesn’t exist and should show a 404), WordPress will automatically redirect to the correct page, /today-is-monday-finally. I do not want this to happen.

    Does anyone know how to make a 404 page display for pages that do not exist at all?

    Thanks!

    wp_rewrite_rules are old school – WP supports server RW rules and that is what should be used.

    That said, look at default theme 404.php file

    Thread Starter bsean23

    (@bsean23)

    @Seacost:
    That would make sense if it was old school. The post was from a long, long time ago.

    The default 404.php file looks fine.

    If I go to something like domain.com/4jfsdi4hgd, I do get a 404 error. (Obviously I have no page close to that). But like I said, if I had an actual page at domain.com/today-is-monday-finally/ and only typed in domain.com/today-is-monday/, then I would automatically be redirected to the “today-is-monday-finally” page. I don’t want that to happen. I want a 404 page to be shown.

    Can anyone offer some advice?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Force 404 Page – Stop page redirects…’ is closed to new replies.