WordPress.org

Forums

404 Page doesn't resolve, just shows code from my sidenav (23 posts)

  1. ewengcameron
    Member
    Posted 6 years ago #

    I'm using WordPress 2.6.2 and my 404 page is having some issues.

    My site:

    http://www.ewengcameron.com

    A page that doesn't exist:

    http://www.ewengcameron.com/2008/10/07/someone-buy-me-a-bdc-rich-stealth-chuck-schuldiner/

    The result is that the URL is the page title and the contents of it is source code starting at my sidenav running to the end.

    I have never seen the 404 page up until now so I'm not 100% sure if it has ever worked. Has anyone seen anything similar? I've checked through the posts here but it's hard to explain so I may have missed something.

  2. julian384
    Member
    Posted 6 years ago #

    I get the same problem and it is driving me mad.

    I am using 2.6.2 on PHP 5.

    I have permalinks as the postname.

    The code that shows on mine starts at a point in the header and continues to the end of the page.

    Can anybody help?

  3. ewengcameron
    Member
    Posted 6 years ago #

    julian

    what Plug-Ins have you installed?

    i've got 1 Click Upgrade, All In One SEO, Last.fm Records, Social Bookmarking links.

    I'm using the Modern theme from Performancing.

    You using any of these? Do you host your own site? If you post or PM me a URL i could have a look and see if we have anything similar that might explain the issue. At the moment, I'm stumped and Google isn't liking the fact I haven't got a 404 page.

  4. dartiss
    Member
    Posted 6 years ago #

    Hey guys, I'm having just the same frustration. I'll tried deactivating all plugins without any success.

    I have quite a few plugins installed but none of those that you list.

  5. @mercime
    Volunteer Moderator
    Posted 6 years ago #

    @ewengcameron: code appearance on your 404 page due to missing codes in your 404.php. Open the 404.php of your theme in notepad or bbedit. Check to see that the following code is there:

    <?php get_header(); ?>
    <div id="content">
    <div id="contentleft">
    <h1>Not Found, Error 404</h1>
    <p>The page you are looking for no longer exists.</p>
    </div>
    <?php include(TEMPLATEPATH."/l_sidebar.php");?>
    <?php include(TEMPLATEPATH."/r_sidebar.php");?>
    </div>
    <!-- The main column ends  -->
    <?php get_footer(); ?>
  6. ewengcameron
    Member
    Posted 6 years ago #

    Cheers for the code!

    My current code is

    <?php get_header(); ?>
    
    <div id="content">
    
    <div id="contentleft">
    	<h1>Not Found, Error 404</h1>
    	The page you are looking for no longer exists.
    
    	</div>
    
    <?php include(TEMPLATEPATH."/l_sidebar.php");?>
    
    <?php include(TEMPLATEPATH."/r_sidebar.php");?>
    
    </div>
    
    <!-- The main column ends  -->
    
    <?php get_footer(); ?>

    I just updated the file to the code you quoted (can't see any difference) and its still broken :(.

    I've just FTP'd into the server and checked the file, its got the correct code in. Its sitting in:

    htdocs/wp-content/themes/modernpaper-10/404.php

    I know a bit about htaccess and I'm a PHP coder by profession so I should be able to fix this but I don't wanna start tinkering with it if its a common problem, or anything that's been solved before.

    Any ideas?

  7. julian384
    Member
    Posted 6 years ago #

    ewengcameron,

    The only plug in I have out of those is 1 click upgrade but surely that can't cause this?

    My 404.php file has all the needed code. And it calls it but the code displayed is only part of what should be in the header. It starts part of the way through a nav bar that i have across the top of the page.

    I can't really show you the page as it is for a company that I work for and it isn't for outside eyes, sorry.

    Not sure where to go from here.

    If it helps the page starts with 'Content-Length: 15668' and then just starts showing code from a point in the header. Not sure if that tells anybody anything?

  8. ewengcameron
    Member
    Posted 6 years ago #

    I might do a manual update to check if that was an issue.

    I'll let you know how it turns out!

  9. nemonet
    Member
    Posted 6 years ago #

    Im having same problem. When view source of parsed page no text from 404.

    I checked search.php as it seeems it might be searching.

    Also checked htaccess.

    This is what ive found so far:

    Check your Front Page Display (under Settings, Reading). It looks like you're not using Posts, only Pages - I had the same problem on a WordPress.com blog and the way I "resolved" it was by making up a fake Post and setting that as the Posts page. I have no idea why that worked or what causes the problem though.

    When I tried this trick, I noticed that my "Posts" drop down listed Pages not posts. Eh?

    From webmaster world:

    <?php
    if (is_single() && !have_posts())
    {
    header("HTTP/1.0 404 not Found");
    }
    ?>

    Did not work for me either.

    I think it has to do with the index.php file in the theme Im using. Dont want to spend to much time unless its something else.

    Anyone else?

  10. ewengcameron
    Member
    Posted 6 years ago #

    I've not had the time to reinstalll WP yet.

    I have tried changing themes and that doesn't help so I don't think its a problem with the theme.

    I'm pretty stumped on this one.

    Nemonet, are you using 1-click upgrade?

  11. KalJer
    Member
    Posted 6 years ago #

    Hi guys,

    I too am having the same problem. As you can see here (using tinyURL so google doesn't index this post relative to my site)

    I'm running 2.6 with the following plugins active:

    CForms
    Page Lists Plus
    Register Plus
    Themed Login and Register

    I can say with 95% confidence that the problem existed before the last two were installed.

    Here is the code from my 404 page:

    <?php get_header(); ?> 
    
    <?php if (have_posts()) : ?>
    
    <?php while (have_posts()) : the_post(); ?>
    
    <div id="content">
    
    <div id="content_posts_wrapper">
    
    <div class="post">
    
    <div class="page_content_post">	
    
    <h2>404 Page</h2>
    
    <div class="actual_post">
    
    </div>
    </div>
    <div class="clear"></div>
    </div>
    
    <?php endwhile; ?>
    
    <?php endif; ?>
    
    </div>
    
    <?php get_sidebar(); ?> 
    
    <?php get_footer(); ?>

    Any ideas?

  12. KalJer
    Member
    Posted 6 years ago #

    Update:

    It looks like the code for the 404 page itself is actually good, if I point the url to:
    mysite.com/wordpress/wp-content/themes/mycurrenttheme/404.php it works

    The problem seems to be that the location of the 404 page is impropperly specified (I'm guessing maybe due to permalink re-write rules) could this be the problem everyone else is having as well?

    Does anyone know where I can change the 404 URL specification??

  13. julian384
    Member
    Posted 6 years ago #

    I think this might be to do with rewrite rules.

    I did have the postname rewrite but have switched it off and now URL/?tag=TAGNAME works fine.

    Don't know why his bug occurs but I guess you just have to switch off rewrite or not have tags.

    Out of interest who are you hosted with? Mine is with streamline.net. It might be interesting to compare phpinfo files? I'll get mine tonight and post it here.

  14. ewengcameron
    Member
    Posted 6 years ago #

    My site is hosted with streamline.net too and i have got the rewrite using data & postname.

    Looks like KalJer has fixed the issue, (check the link he/she posted). Hopefully they'll let us know the issue.

  15. Darren Turpin
    Member
    Posted 6 years ago #

    Having exactly the same problem with a whole selection of WP sites (various versions) all of them hosted on Fasthosts in the UK.

    Have been talking to Fasthosts support and they've identified some sort of clash (although they haven't been much more specific than that with the line:

    RewriteRule . /index.php [L]

    in the .htaccess files, which is something essential to do with permalinks (?)

    The problem doesn't occur on another WP site I have hosted with DataFlame, but clearly streamline.net have issues as well, so I'm guessing it's to do with some server setup that these two hosts have in common?

    Still talking to Fasthosts support about the issue. If I find a definite solution, I'll post one here.

  16. ewengcameron
    Member
    Posted 6 years ago #

    I think streamline are actually a fasthosts reseller, not 100% sure though. Happening here too.

    Any ideas?

  17. Darren Turpin
    Member
    Posted 6 years ago #

    Actually, that other post is one of mine as well... was hoping to attract the notice of someone who knows a lot more than me about server management, but so far no luck.

    And Fasthosts have, sadly, gone silent on the issue. Will chase again on Monday and if nothing is forthcoming, will start considering a mass-migration in the new year.

  18. juliageek
    Member
    Posted 6 years ago #

    Hi
    Did you get any joy from fasthosts? I've got the exact same problem here.
    Thanks

    Julia

  19. Darren Turpin
    Member
    Posted 6 years ago #

    Still waiting to hear something positive. Had an email from the support guy I spoke to initially who said he'd managed to gather enough evidence of a problem for the third-line engineers to get involved, so hopefully they'll be looking at it before too long.

  20. ewengcameron
    Member
    Posted 6 years ago #

    anyone heard back from Fasthosts/Streamline?

    i can't use my Google Webmaster Tools til the site verifies properly and if i have to move, i'll shift all 4 sites i've got with them to a better hosting company. they are pretty unreliable anyway, takes ages for pages to load and sometimes they just don't load.

  21. Jay_Me_Ess
    Member
    Posted 6 years ago #

    I have spoken to Fasthosts a couple of times lately and they haven't been to helpfull on this error. I have found people complaining about this issue in a couple of threads here. I have explained the extent of my issue which I think that others might be suffering from and not realise here.

    Any insight on these issues would be most welcome. I'm more than willing to try stuff out if anyone has any ideas they want to experiment with. When i first installed my blog i'm pretty sure the error page was working however i didn't really pay much attention until i realised that it was quite an issue, affecting more than just the 404 pages but the older posts permalinks as well. I hope someone can come up with a solution otherwise i'll have to change host and that's going to be a pain in the behind.

  22. Nyleveia
    Member
    Posted 5 years ago #

    Found a bit of a quick fix for fasthost users.
    Firstly, if you can, create a page within wordpress for your 404 information (or setup some other form of 404 page), then go to the 404.php code and replace the entire block of code within that to the following :

    <?php
    header( 'Location: http://www.domain.com/404.php' ) ;
    ?>

    Save, and then your error pages wont be messed up anymore.
    Not perfect, but better than nothing!

  23. Darren Turpin
    Member
    Posted 5 years ago #

    Yep - that works: http://www.iain-banks.net/error-wrong-page-dammit

    An extremely elegant and simple interim solution to the problem as well. Thank you Nyleveia!

Topic Closed

This topic has been closed to new replies.

About this Topic