Support » How-To and Troubleshooting » 404 Page With Themes Disabled

404 Page With Themes Disabled

  • After much time trying to figure out how to make a 404 page when themes were disabled, I’ve found a workaround. Since “theme-less” wordpress ignores any 404.php, .htaccess and (I assume) server configuration of ErrorDocument rules, page viewers are redirected to the index of the wordpress blog, which isn’t really an ideal situation.

    Here’s a way to ‘fake’ the 404 page just so users have a better understanding of what’s going on.

    $index = 'index.php';   // whatever your index page is
    if(WP_USE_THEMES == false && !ereg('^/('.$index.')?$', $_SERVER['REQUEST_URI'])) {
    // place what you want users to see
    // when they get a 404
    else {
    // place The Loop code here

    If anyone can think of a better way to implement this and/or modify it, feel free.

  • The topic ‘404 Page With Themes Disabled’ is closed to new replies.