WordPress 404 Error Pages in IE 5, 6, 7, 8, & 9
When you use WordPress and try and open a page that doesn’t exist in internet Explorer 5, 6, 7, 8, or 9, the 404 error page doesn’t display like in other browsers.
If you also have this problem just follow the simple instructions below, to get your 404 error page working.
Open your 404.php with a text editor or your usual program. It is usually in the template folder of the theme you are using, and just add these 2 lines of code, before everything else at the top of the opened file, then save it and upload the file.
<!--?php ob_start(); ?--> <!--?php header("HTTP/1.1 404 Not Found"); ?-->
Your 404 error page should be working perfectly now in IE5, IE6, IE7, IE8 and IE9.
Glen Charles Rowell
Here is an example of the code I am using on one page:
<?php ob_start(); ?>
<?php header("HTTP/1.1 404 Not Found"); ?>
<?php get_header(); ?>
<div id="content">
<div class="post">
<h2 class="title title_page"><?php _e('Error 404 - Not Found', 'zbench'); ?></h2>
<div class="entry">
<p><?php _e('Sorry, but you are looking for something that isn’t here.', 'zbench'); ?></p>
<h3><?php _e('Random Posts', 'zbench'); ?></h3>
<ul>
<?php
$rand_posts = get_posts('numberposts=5&orderby=rand');
foreach( $rand_posts as $post ) :
?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
<h3><?php _e('Tag Cloud', 'zbench'); ?></h3>
<?php wp_tag_cloud('smallest=9&largest=22&unit=pt&number=200&format=flat&orderby=name&order=ASC');?>
</div><!--entry-->
</div><!--post-->
</div><!--content-->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Everyone would benefit from reading this post. Thanks for the info.