Installing and hosting WordPress on Windows is plain simple. Just follow one of many PHP installation guides, install MySQL, download and extract WordPress and you are done.
Well, except when dreaded "Failed opening required './wp-blog-header.php'" error occurs. That's where fun stops.
Warning: main(./wp-blog-header.php) [function.main]: failed to create stream: No such file or directory in D:\WWW\somewebsite\index.php on line 3
Fatal error: main() [function.main]: Failed opening required './wp-blog-header.php' (include_path='.;c:\php4\pear') in D:\WWW\somewebsite\index.php on line 3
I have been searching for a solution for some time and found nothing that would work every time. Most of the time IIS is to blame and changing the source code is just not a viable solution.
This is how I worked around the problem and it seems to work great:
1) Don't install WP in the root of your domain like http://nauticalinks.com. Use a directory like http://nauticalinks.com/blog.
2) Create automatic redirection from root to /blog.
You can do that using JavaScript. Just put following in default.htm in the root:
<HEAD>
<SCRIPT language="JavaScript">
<!--
window.location=http://someplace.com/blog;
//-->
</SCRIPT>
</HEAD>
But since I had a site in root and Google indexed it and there are probably some link to there which I don't want to loose I wrote my first and second PHP line of code instead of JavaScript above:
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: /blog".$_SERVER['REQUEST_URI']);
?>
This will permanently redirect every request to same request with /blog inserted in URL.
I did that about a month ago and Google picked it up nicely. Whole index is still there but updated to new URLs.
PS: This is actually my first and second PHP line in my life, I wasn't kidding. If you know a better way to accomplished what I tried to do, please let me know in the comments!