The MU forums have moved to WordPress.org

404 page not coming (45 posts)

  1. flywitness
    Member
    Posted 15 years ago #

    when i go to any random url, i just get a blank page. if i'm logged in there is a link saying "edit this entry". clicking it does nothing.

    this only happens when wpmu is installed to use subdirs, not sub domains.

    ive re-installed several times under different daomains. always the same. like i say - using subdomains version works fine.

    anybody know anything?

  2. andrea_r
    Moderator
    Posted 15 years ago #

    Blank page as in completely white? Means an error. Usually with a plugin.

  3. flywitness
    Member
    Posted 15 years ago #

    sorry. should have been more clear. its not totally blank. it displays the template ok. no errors other than instead of showing a 'not found' or similar message, it simply displays nothing in the content area (or just an 'edit this post' link when logged in). header, sidebar and footer are all present.

    happens on a completely fresh install. no plugins or themes or alterations/adulterations of any kind.

  4. andrea_r
    Moderator
    Posted 15 years ago #

    And this is on entries that exist?

  5. flywitness
    Member
    Posted 15 years ago #

    no. i intentionally enter in invalid url. i want to see a 404 error.

    in addition to info above - without permalinks, it redirects to index which i assume is by design. however, with permalinks on, i get the behaviour described above.

    so far i have discovered that this rule:

    (.+?)(/[0-9]+)?/?$

    is matching every invalid url i throw at it which causes this code to run:

    // If we're processing a 404 request, clear the error var
    // since we found something.
    if (isset($_GET['error']))
    unset($_GET['error']);
    if (isset($error))
    unset($error);

    this may be irrelevant.

  6. flywitness
    Member
    Posted 15 years ago #

    commenting out that bit of code makes no difference. it seems irrelevant.

  7. andrea_r
    Moderator
    Posted 15 years ago #

    The more I read your posts about all the issues you're experiencing, them more I'm convinced your server setup is whacked.

    The default theme included has a 404 template. All 404's should show it. There's a message that states "Sorry, no posts matched your criteria."

    The install I set up yesterday does. http://sillyandrea.com

    What kind of hosting are you on? Shared? VPS? Got access to Apache?

  8. flywitness
    Member
    Posted 15 years ago #

    http://sillyandrea.com/dufflink

    yours does exactly the same

    in class WP, $req_uri and $self end up the same so this:

    if (empty($request) || $req_uri == $self || strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false)

    runs this:

    $this->did_permalink = false;

    which means that in function handle_404, this:

    if ( (0 == count($wp_query->posts)) && !is_404() && !is_search() && ( $this->did_permalink || (!empty($_SERVER['QUERY_STRING']) && (false === strpos($_SERVER['REQUEST_URI'], '?'))) ) )

    returns false which prevents this:

    $wp_query->set_404();

    from happening.

    comment out this:

    $this->did_permalink = false;

    and you will get a 404 message.

    a hack i am reluctant to make

  9. lambic
    Member
    Posted 15 years ago #

    I have the same issue, and am also reluctant to start hacking core. Anyone have other suggestions?

  10. lambic
    Member
    Posted 15 years ago #

    For now I've changed this:

    $this->did_permalink = false;

    to this:

    if (empty($req_uri))
        $this->did_permalink = false;
  11. xyzzy
    Member
    Posted 15 years ago #

    I'm experiencing the same exact problem on a fresh install of WPMU!

  12. tdjcbe
    Member
    Posted 15 years ago #

    http://codex.wordpress.org/Debugging_WPMU

    Lots of good info in that file and what you need to be checking and what information you need to include when asking for help.

  13. hempsworth
    Member
    Posted 15 years ago #

    I am experiencing exactly the same problem with a fresh install of WPMU 2.6.1, on Dreamhost by the way.

    I'm also not keen on hacking the core, any chance we could have a mu-plugin or a patch to fix this?

  14. andrea_r
    Moderator
    Posted 15 years ago #

    Has anyone bothered to file a trac ticket?

  15. hempsworth
    Member
    Posted 15 years ago #

  16. tdjcbe
    Member
    Posted 15 years ago #

    Has anyone bothered to look at their webserver's error logs?

  17. hempsworth
    Member
    Posted 15 years ago #

    Nothing in my error logs, can't speak for others though.

  18. donncha
    Key Master
    Posted 15 years ago #

    I just tried this on my 2.6.2 testbed and it's showing a 404. Please update to the latest if you have a test server and confirm it's fixed!

  19. hempsworth
    Member
    Posted 15 years ago #

    I just updated to latest and it's still happening... Revision 1495

  20. donncha
    Key Master
    Posted 15 years ago #

    hempsworth - I suspect you're probably using trunk? You should grab branches/2.6 instead. It's fixed there.

    EDIT, just reinstalled with a folders install and I'm seeing the same problem. Grr.

  21. donncha
    Key Master
    Posted 15 years ago #

    It's the empty PHP_SELF check in wp-settings.php that's messing things up. If we could check that the blog is not the main blog we could not modify it, but $current_blog isn't defined when the check is made.
    Ryan saw this a while back .. http://trac.mu.wordpress.org/ticket/626#comment:9

  22. donncha
    Key Master
    Posted 15 years ago #

    hempsworth - is $_SERVER[ 'PHP_SELF' ] defined? echo it before it gets mangled in wp-settings.php. Are you using PHP5?

  23. donncha
    Key Master
    Posted 15 years ago #

    Updated the wp-settings.php, but if your PHP_SELF is really empty you'll still see this behaviour http://trac.mu.wordpress.org/changeset/1497

  24. levifig
    Member
    Posted 15 years ago #

    +1 same problem here!
    I'm glad I searched the forum for similar problems before wasting hours of my time trying to figure out a solution... :/

    I'll patiently wait for a solution... (A)

  25. tdjcbe
    Member
    Posted 15 years ago #

    Did you see the points that Donncha raised in his last two posts? It would be helpful if you checked on them.

    Thanks though for searching. :)

  26. RobMoore
    Member
    Posted 15 years ago #

    I have the same problem, and I have been following this thread with interest for the last month or so.

    It would be good if the Wordpress code detected the 404 itself and acted appropriately, however I have come up with a work around for it.

    I detect on the page itself (and have similar code for the single page, archive page etc. instead of the code that says "Sorry, no posts matched your criteria.") whether it is a 404 and if it is, I include the 404 template (to which I added a 404 Not Found header):

    <?php
    	if (have_posts()) {
    
    		get_header();
    ?>
    
    <div id="content" class="narrowcolumn">
    
    	<h1><?php bloginfo("name"); ?></h1>
    
    	<?php while (have_posts()) : the_post(); ?>
    
    		<div class="post" id="post-<?php the_ID(); ?>">
    		<h2><?php the_title(); ?></h2>
    
    			<div class="entry">
    				<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
    
    				<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    
    			</div>
    		</div>
    
    	<?php endwhile; ?>
    
    	<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    
    </div>
    <?php
    		get_sidebar();
    		get_footer();
    	} else {
    		include "404.php";
    	}
    ?>

    Also, something interesting to note, I just upgraded my codebase from Mu 1.6.1 to 1.6.3 and the PHP_SELF change that Donncha introduced in change 1497 had the side effect of causing my site-wide tags page (/tags/<TAG>/), which works by using a template_redirect to a "tag_results" template to be detected as a 404 page and a redirect to the first post that comes up after querying the db for published posts with the name '<TAG>%'. I've tracked the problem to PHP_SELF being set to index.php instead of /tags/<TAG>/ as it was in 1.6.1. To fix the problem I removed all the template redirect stuff and simply put a tags directory in and did a .htaccess rewrite for the tags.

  27. hungeski
    Member
    Posted 15 years ago #

    That works for me. Thanks, RobMoore.

  28. Viennese
    Member
    Posted 15 years ago #

    I am on WPMU 2.6.3 installed using subdirectories and still have this problem. To be specific, the main blog shows 404 correctly. The sub-blogs do not show 404.

  29. andrea_r
    Moderator
    Posted 15 years ago #

    Upgrade. it was fixed.

  30. Viennese
    Member
    Posted 15 years ago #

    I have upgraded, now to WPMU 2.6.5. The no 404 problem still exists, at least for me.

    I read donncha's post earlier which mentioned testing on version 2.6.2. In my previous post, I was using version 2.6.3. Now I am using version 2.6.5.

    I am having the no 404 problem on an installation using subdirectories, and the 404 is missing on the sub-blogs but works on the main blog.

About this Topic

  • Started 15 years ago by flywitness
  • Latest reply from tomgf