Saturday, May 24, 2008

Install WordPress MU On IIS With Url Rewrite

I have successfully installed WordPress MU on my Windows Server 2003 running IIS 6. To be honest, I know that WPMU is not full compatible with IIS right out of the box. It relies heavily on apaches mod_rewrite, which IIS isn't capable of. The only IIS fix for permalinks I've seen have either been via a special filter named ISAPI_Rewrite.

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS server. It is compatible with Apache mod_rewrite making it possible to move configurations from Apache to IIS and vice versa just by copying .htaccess files. I have tested with Wordpress 2.x or Wordpress MU 1.3.x, it's work. This is also works in IIS Mod-Rewrite Pro, but IIS Mod-Rewrite Pro have no free version.

To enable Clean Permalinks on Wordpress MU on IIS, follow these steps:

  • Install PHP and MySQL following the vendor's instructions.

  • Install ISAPI_Rewrite.

  • Install Wordpress according to the vendor's instructions.

  • Open with a text editor the file wp-settings.php, located in Wordpress root directory. Add the code line



$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];

  • Log on to Wordpress as administrator, go to admin panel, open the "Permalinks" settings page, and set the permalink structure of your choice. Apply your changes.

  • Wordpress is supposed to automatically create a file with name ".htaccess" in its root directory. Open with a text editor the file .htaccess, copy it and paste into httpd.conf in ISAPI_Rewrite directory.


Now we have a WordPress MU with clean permalinks on Windows Server 2003 running IIS 6.