How to set a subdirectory site for site-wide 404 page?

I have an MU network based on the zatz.com domain. When you go to zatz.com, it automatically takes you to the main info site, which is zatz.com/info. When you go to zatz.com/computingunplugged, you go to the Computing Unplugged site.

But when you go to a site that doesn’t exist, or a page that doesn’t exist (like zatz.com/palmpower), it takes you to the base zatz.com.

What I’d like to do is either (a) have a failed request always go to the page-not-found page of zatz.com/info or just to the main zatz.com/info, regardless of what the failed request requests.

Can I do this, and how?

Thanks!

–David

  • aecnu
    • WP Unicorn

    Greetings David,

    Thank you for this great question.

    The answer is the htaccess file, put these on top with your preferred URL:

    ErrorDocument 404 http://yourredirectpage.com/page.htm
    ErrorDocument 400 http://yourredirectpage.com/page.htm
    ErrorDocument 401 http://yourredirectpage.com/page.htm
    ErrorDocument 403 http://yourredirectpage.com/page.htm
    ErrorDocument 500 http://yourredirectpage.com/page.htm

    It makes no difference if your page extension is php or htm/html

    That should do the job for you.

    Cheers, Joe

  • aecnu
    • WP Unicorn

    Greetings David,

    Thank you for the additional question which is certainly appreciated.

    I have never seen WordPress change a htaccess in that way even during an update because it usually sticks to only messing with stuff between the WordPress begin and WordPress end indicators.

    However, to answer the question directly regarding placing these else where, they would be placed in the httpd.conf file :smiley:

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.