• For some reason my 404 page is not loading and all I am getting is html code displayed, so if I choose a page that doesn’t exist I get html displayed instead of the formatted page like this;

    <div id=”columns”><!– START MAIN CONTENT COLUMNS –>
    <div class=”col1″>

    <div id=”archivebox”>

    <h3>404 | Page Not Found!</h3>
    <div class=”archivefeed”>Sorry, but the page you were looking for is not here.</div>

    </div><!–/archivebox–>

    </div><!–/col1–>
    <div class=”col2″>

    Have disabled all plugins and no effect.

Viewing 13 replies - 1 through 13 (of 13 total)
  • It’s possible that all of the < and >s have been made into HTML elements.

    Do you have a link to the site so I could take a look?

    Thread Starter sji2671

    (@sji2671)

    Thanks – yes the site is ullapool.co.uk, if you make up any pages like /ghghgy you will see what I mean.

    Okie doke. It looks like a tag or an echo statement hasn’t been ended properly.

    Could you check your theme files (Appearance -> editor in the WP Dashboard) to see if you have a 404.php file (listed down the right hand side) as part of your template files and, if so, could you copy out the code and paste it in the pastebin here:

    http://wordpress.pastebin.ca/

    Then post the link to the pastebin back here.

    If you don’t have a 404.php, could you see if you have a searchform.php and post that instead.

    Thanks,

    Si

    Thread Starter sji2671

    (@sji2671)

    thanks, yes there is a 404.php page, the code is:
    http://wordpress.pastebin.ca/1567271

    I don’t think it’s your 404.php page, could you post your header.php code to another pastebin for me?

    If you could also log into your WP dashboard and let me know what your current permalinks setting is (Settings -> Permalinks), that would be great.

    Thanks,

    Si

    Thread Starter sji2671

    (@sji2671)

    Permalinks: /%postname%.html (needed to maintain old site structure)

    Header.php: http://wordpress.pastebin.ca/1568214

    OK, it’s the permalink structure that’s causing the 404 page to fail. If you type in ullapool.co.uk/rubbishURL.html you’ll get a more coherent 404 page than before (though the styling is still broken).

    If you could temporarily switch the permalink structure to

    /%postname%/

    And then see if that fixes it. You can change it back once we’ve verified whether or not it works, but it’ll help track down the root cause of the problem.

    Also, could you confirm that your pages accom.html, accomodation2.html and so on are WordPress generated pages?

    Thread Starter sji2671

    (@sji2671)

    Hi Simon, I changed the permalinks to /%postname%/ but that didn’t solve it. All the current posts/pages then just gave the visual html instead of a proper 404 page so I have changed it back.

    Yes accom.html etc are all posts.

    Could you try the following for me? You may want to make a copy of your 404.php file as a backup.

    Remove the following line:

    <?php get_header(); ?>

    And in its place, add everything from here:

    http://wordpress.pastebin.ca/1569445

    Thread Starter sji2671

    (@sji2671)

    Done that, doesn’t appear to have changed things.

    OK, try replacing all of that with this:

    http://wordpress.pastebin.ca/1569527

    The above is basically a header with absolutely no PHP in it. At the moment your page isn’t rendering any of the header information at all – not even your opening html tag.

    If this doesn’t work, then I think it might be an issue with your .htaccess file or some other server-level issue.

    Could you log on to your ftp and get a copy of your .htaccess file, then post the contents here?

    Also, which hosting company are you using?

    Thread Starter sji2671

    (@sji2671)

    404.php has been updated with the html code.
    That changes things, I am now getting a web page is not available and no longer the displayed html code.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘not getting 404 errors’ is closed to new replies.