Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As my previous server was a Linux powered machine I have this piece of code:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?path=$1 [NS,L]

This piece of code will put the information in the URL like this:

into an array like this:

array ( 0 => "nr1", 1 => "nr2", 2 => "nr3")

My new server machine is an Windows 2008 (IIS) based server. Now i would like to use the mod_rewrite mod on my new server aswell. In short my question is:

Can anyone tell me, or link me to a tutorial that tells me, how to install/use the mod_rewrite mod (or any mod that does the same thing) and translate the code above into a format i can use on my windows based server.

I still use php, not ASP.NET, I know many people will say use apache or something, but IIS usage is needed unfortunately.

Many thanks in advance!

share|improve this question
up vote 3 down vote accepted

I quite like the IIS Rewrite Module because it's fully integrated into the web.config file (the IIS equivalent of .htaccess).

But if you're after an exact syntax match, ISAPI Rewrite is your friend. It has (as far as I can tell anyway) 100% compatibility with Apache's mod_rewrite module in a .htaccess file (and actually uses a .htaccess file which looks really weird in Windows Explorer to see a valid file without a filename)

share|improve this answer
The only thing i care about is that i get the exact same output to my php (right now its a string of everyting behind the domain which i explode on / giving the array). If i can get this result from the rewrite module I'd be happy to use it. Any idea on how to translate this into the iis way of doing this? (I have not made this .htaccess code myself, and dont know much about it to be honest). – dragon112 Nov 21 '11 at 11:50
As the website may actually be migrated to a linux machine in the future i decided to use the Hellicon Ape ( mod. It seems to be exactly what i need!! Thanks for pointing me in the right direction! – dragon112 Nov 21 '11 at 12:41

Microsoft's Official IIS site has the Rewrite module you're looking for.

If you're familiar with mod_rewrite, the IIS equivalents are pretty similar. Otherwise there are plenty of guides around the net. The original intent of the module was to mirror mod_rewrite, so it's pretty similar though they have grown in slightly different directions.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.