Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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]
</IfModule>

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

http://www.example.com/nr1/nr2/nr3/

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
add comment

2 Answers

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 (helicontech.com/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
add comment

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
add comment

Your Answer

 
discard

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.