• I have a website run on WordPress and the theme’s 404 page comes up when a nonexistent page is called. That’s fine.

    However, I have a subsite within the same URL which has it’s own subdirectory This subsite is NOT part of WordPress. I would like any 404’s that arise from a page within the subdirectory (and below) to display a different error page.

    I have created an .htaccess file in that subdirectory with the line:
    ErrorDocument 404 /error/new404.html
    and the appropriate html page in the indicated place.

    Unfortunately, if a non existent page is called in the subdirectory, I still get the root (i.e. WordPress 404.php) and not the file for that directory.

    Can you help me please and tell me what I am missing?

    TIA

Viewing 3 replies - 1 through 3 (of 3 total)
  • It could be to do with the fact that WordPress being in the main root of your file server directory will take all requests it can unless explicitly specified. So instead of just using the relative path, use an absolute path like so: –

    ErrorDocument 404 https://www.mydomainname.com/error/new404.html

    See if that works for you and come back if it doesn’t.

    Thread Starter bnrepiano

    (@bnrepiano)

    Thanks for your advice.
    Sorry, no it didn’t work. Still reverts back to the theme’s 404.php
    Brian

    Okay not to worry. Try step 3 at this link and see if that works for you. You can keep the change I suggested in your .htaccess file or revert it. It doesn’t matter.

    https://wordpress.stackexchange.com/a/20274

    That should do the trick for you. Again, if not though come back and just ask. ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Separate 404 error page needed’ is closed to new replies.