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.

I am used to working with Apache servers, so when mod_rewrite is enabled, I can create an htaccess file and use url rewriting.

Here's my htaccess file:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

now I've built this site that uses this url rewriting module but I have come to learn that it is a microsoft server. Can I use my htaccess file? Is there something I need to change to get it to work? How can I tell if url rewriting is set up on the microsoft server?

Update: Is there a free version that I can install that works with htaccess files?

share|improve this question
add comment

7 Answers

up vote 0 down vote accepted

ISAPI-Rewrite 3 from HeliconTech has very Apache-like syntax. The above config will work in ISAPI_Rewrite3 .htaccess without any modifications.

share|improve this answer
add comment

You can import Apache mod_rewrite rules (not all of them, mind you) into the Microsoft URL rewriting engine for IIS7.

You can also install Ionics Isapi Rewrite Filter, an open-source mod_rewrite-alike for IIS 6 and 7. Another poster linked Helicon, which is similar, but costlier.

share|improve this answer
add comment

IIRC, IIS does not come with re-writing abilities out of the box. When we need to re-write, we use ISAPI Re-Write from HeliconTech. It's not free, but it is very cheap.

It will give you a file called httpd.ini - you put it in the root of your site like you would a .HTACCESS and it does the rest.

The format of the file is different, but it isn't that different.

share|improve this answer
add comment

THe isapi filters mentioned should work fine. You can also use urlrewriting.net or UrlRewriter.NET if you want to take the time to go .net. Both are free and will avoid the ISAPI filter hit. Your best option however is the IIS 7 URL rewrite module

share|improve this answer
add comment

Here's some information about IIS Mod-Rewrite from micronovae. I'm just starting to learn about it after discovering that CrystalTech uses it. It's a little more expensive than ISAPI_Rewrite.

share|improve this answer
add comment

IIRF (Ionic's ISAPI Rewrite Filter) will work with that .htaccess file, unchanged. Well, you have to rename it.

There are some features that Apache's mod-rewrite has that IIRF does not, but your .htaccess file will work with no changes.

share|improve this answer
add comment

Since I was running my WordPress blog (blog.jaspio.net) on a cheap IIS host, I wasn't allowed to install an ISAPI filter.

I then came across Tom Bristol's great little ASP script to parse the .htaccess file to ensure that I had nice clean SEO links instead of querystrings.

Give it a go!

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.