[wp-hackers] PATH_INFO & IIS help

Owen Winkler ringmaster at midnightcircus.com
Mon Nov 8 22:27:04 UTC 2004


I'm trying to assemble a little info on installing WordPress on Windows 
IIS for the codex.  This is proving more difficult than expected because 
many issues are simply not solved.

The first firm issue I'm attempting to tackle is using friendly URLs 
with WordPress.

It's commonly known that mod_rewrite doesn't exist for IIS, and that the 
alternatives are costly and not completely compatible with the way that 
WP writes rewrite rules.  So my idea was to take the easiest route to 
success and explain the use of PATH_INFO for codex.  Except, I have had 
no success getting this to work on IIS.

I assume that Apache passes the remainder of the URI through to the 
script that is mentioned mid-URI.  This is not the case on IIS, and 
there is no way that I can find to configure this behavior.

An alternative might be to set the WP index.php as the custom 404 page 
for the WP directory in the IIS configuration.  Then every request made 
on that directory would be routed through to the index page.  The 
problem is that IIS changes the PATH_INFO, so the index.php doesn't know 
what to display.

Fortunately, the bad URL info is stuffed into the query string.  So if I 
make a bad page request, I see the following in my $_SERVER['QUERY_STRING']:

404;http://localhost/wordpress/index.php/2004/10/20/hello-world/

This string is the error code, a semicolon, and the original URI.

I've read of several possible solutions for getting this to work on IIS. 
  Some include setting metabase properties on the server, which is akin 
to setting the root http.conf on Linux - something that hosted users 
won't be able to do.  I've read of other solutions that patch PHP 
directly, but this seems impractical also.  Besides that, none of the 
solutions I've read about actually worked on my test install.

So...  Who has PATH_INFO working on IIS, and if you do, then how?  Will 
a hosted user be able to accomplish the changes necessary to run 
WordPress with friendly URLs?

If my suspicions are correct, it's going to take a minor act of God (or 
ISP) to get it to work on IIS, and an alternative based on the 404 
information I provided above might be a good inclusion.  If so, I can 
write a patch.

Owen






More information about the hackers mailing list