I’ve been working on this problem for two days after starting this blog and browsed the Internet a lot in search of solution. I must say there are a lot of posts, a lot of links, a lot of opinions and a lot of provided “working” solutions but for me (IIS6 + blog in in subdirectory) nothing worked. Some posts were quite old and were for example for IIS5, some were only for blogs located in the root directory and in order to implement the others, it was necessary to buy the additional program that would mimic asapi Apache filter.
The solution I found worked for me, so I have stopped the search. Maybe the new Wordpress updates will come or new IISs will come and they will break the fragile structure of the redirect construction (as always) but at the moment I’m happy even though today I’ve heard that the pound is at all time low against Euro at 1.07, which means all British earners lost 1/3 in real terms in Europe and technically across the globe too.
Anyway, here’s the subdirectory located wordpress installation permalinksolution for IIS6 I used:
===> Created the 404 redirect file with the content like this (for example wp-404-redirect.php):
<?php
$qs = $_SERVER['QUERY_STRING'];
$pos = strrpos($qs, ‘://’);
$pos = strpos($qs, ‘/’, $pos + 4);
$_SERVER['REQUEST_URI'] = substr($qs, $pos);
$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
include(’index.php’);
?>
===> Added this file to my blog directory i.e. http://www.everestcomputers.co.uk/blog/.
===> Went to my hosting settings and added three 404 redirects to the above file (404, 404-1 and 404-2) as follows (selected URL rather than FILE):
/blog/wp-404-redirect.php
===> In Wordpress setting added the special permalink structure (it can be different but this one I like the most - it’s concise and informative):
/%year%/%month%/%postnum%
That’s it! It works as required and I’m
looking forward to quality permalink blogging. Still need to change the design, the fonts etc but the good start to the blog is given.





January 20th, 2009 - 9:47 pm
Added a new post regarding the above - apparently, everything is not so simple. See the new post Structured wordpress permalinks on IIS 6 for root location trick.
January 20th, 2009 - 10:02 pm
[...] continuation to the one of the first posts in this blog Nicely structured wordpress permalinks on IIS 6 for subdirectory blog location I need to add something. I was setting up a blog for a friend and encountered an error in the code, [...]