Blank Page when using IIS Permalink hack

I use Pretty WordPress Permalinks on IIS when I need to install WP on a windows server, but on one host I ran into a problem where I would get a blank page if the post didn’t exist instead of the theme’s 404 template. But for some reason it works fine if I just echo something in wp-404-handler.php. I echoed out an HTML comment so it wouldn’t disturb the layout. Here’s my new version of the file:

echo "<!-- If the page doesn't exist I get a blank screen unless I echo something -->";
$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'] = substr($qs, strpos($qs, ':80')+3);

Leave a Reply

Your email address will not be published. Required fields are marked *