iis

This is a frequent question for most IIS users on how to get permalinks to work in WordPress, it's fairly simple really once you know how of course. So the problems are, you're using IIS so using mod_rewrite won't work, you're on a shared server so installing a mod_rewrite alternative for IIS is not available either. You can have URLs with a index.php in them (for example http://www.yourdomain.com/index.php/2009/03/17/getting-permalinks-working-in-wordpress-on-iis) but they're pretty ugly looking and doesn't fit into the URL standards (in other words, it's just nasty).

WordPress Codex has a very useful page about working with permalinks, there's one solution that uses 404 error pages, however when you look at what it does it's very slow and again very nasty. The 404 error solution makes the server try to find the page, it doesn't exist so the server directs the user to the 404 error page, the 404 error page then does it's own working out to figure out where the user should be going, and then it would make it's own HTTP to the correct URL.

This example would work great if only it didn't make a HTTP, so what can we do with this example to make it more efficient.

  1. <?php
  2. $qs = $_SERVER['QUERY_STRING'];
  3. $pos = strrpos($qs, '://');
  4. $pos = strpos($qs, '/', $pos + 4);
  5. $_SERVER['REQUEST_URI'] = substr($qs, $pos);
  6. $_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
  7. include('index.php');
  8. ?>

* Put the above 404 error script in the base of your WordPress directory.

* Set your site's 404 Error Page to the file above

* Setup your permalinks in WordPress -> Options -> Permalinks

Because it's including the index.php file into the script, it's utilising the functionality that is already present in WordPress.

Resources
* Pretty WordPress Permalinks on IIS
* WordPress Codex Permalinks
* 404 Error Solution

From recent tests conducted with StreetDirectory.com shows that PHP executes a lot faster on Windows Server 2008 now with their built-in CGI support. In fact it runs 130% faster then any other server operating system out there.

The built-in support of FastCGI enables PHP applications to run efficiently on Windows Server 2008, with significant performance boosts. As can be seen in the graph from the case study:

The Windows Server 2008 installation was a core installation with no performance tweaks, making it a out-of-the-box solution for all server administrators.

As you can note with the graph above that the 4000 users point, Windows Server 2008 becomes slower then Linux. Dennis from Microsoft says many server administrators would evaluate the performance by looking at where 75% of the maximum hits is located.

If we take the same approach from Dennis here, then most server administrators would be scaling out to another machine at about 45,000 sustained hits, whereas on the Linux box it would be around 30,000 sustained hits.

So what does this mean? Less servers for the administrators to maintain, less hardware to have problems with and less network/software issues to deal with. It will also be cheaper and more effective to scale out when needed or for 'just in case' scenarios.

I haven't been brain washed by Microsoft as a Microsoft Partner but I do seriously believe that Microsoft has made dramatic changes to both Windows Server 2008 and Windows Vista. Look out Linux!

Related Articles
* PHP runs up to 130% faster on Windows Server 2008
* Minty White - PHP runs up to 130% faster on Windows Server 2008
* Windows Server 2008: PHP runs up to 130% faster
* As Windows Server 2008 RTMs, Customers and Partners Adopting with Help of New Tools, Training