Ready to get started?Download WordPress


404 Page With Themes Disabled (1 post)

  1. dapperdanman1400
    Posted 7 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 7 years ago by dapperdanman1400
  • This topic is not resolved
  • WordPress version: 2.2