Does IIS Support URL Rewriting?
No. But then again yes. Let me explain …
URL Rewriting is a technique available on many web servers that
allows you the web master to make changes to URLs requested by clients
before they are processed by your web server.
Become a Patron of Ask Leo! and go ad-free!
This one is best described by example. In a prior entry here I
talked about using
redir.pl
to allow you to log and or redirect when people click an external link
on your site. On the Ask Leo site the links that used
redir.pl look like this:
That example link will take you to http://www.microsoft.com.
Even though redir.pl lets you make short URLs out of long ones, it
still seems rather long and convoluted. And if you care about such things,
many search engine crawlers will not index pages that contain “?” in
their URLs.
Enter URL re-writing. Using URL re-writing, I can specify that any
instance of “r-” in an incoming URL be replaced with
“cgi-bin/redir.pl?”. Then my redirected link looks like this:
The URL redirector intercepts the incoming request, replaces “r-”
with “cgi-bin/redir.pl?”, and passes the result on to IIS for
processing.
My example is quite literal – on this site I replace any
instance of “r-“, which means of course that I cannot use “r-” anywhere
else in any of my URLs. That’s something I’m willing to live with for
simplicity. However most URL rewriters use regular expressions for
pattern matching and replacing, so you can get quite specific and
restrictive if specifying exactly what should get replaced and when.
IIS does not support URL rewriting itself. Rather, it supports an
extension interface called ISAPI which allows add-ons to be installed
into IIS. Add-ons like URL rewriters, for example.
Here are a few of the available rewriters at this writing:
- ISAPI_rewrite –
In addition to a full featured main product, there’s a free “lite”
version for single site servers and for testing the concept. - OpURL.
I can’t believe you have to pay for this simple functionality. God bless open source software like Apache.
I agree with the other comment. This is such a basic piece of web server functionality that it’s ridiculous that there’s no equivalent to mod_rewrite (or the various other similar FREE modules) in Apache.
I guess it shouldn’t be a surprise why Apache has 70% of the market share and rising.
Sigh.
I finally found a free IIS URL rewrite tool after weeks of searching.. right here:
http://www.iistoolshed.com/
I wouldn’t mind springing $50 for a good solution but it seems you have to update software version when migrating between OS (2000 to 2003) and service pack updates. Too much maintenance.
URL Rewrite for MS IIS
http://www.smalig.com/url_rewrite/
Hi All,
I recently released mod_rewrite for IIS free and as opensource.
Check it out at http://www.iismods.com. If you like the filter just let othe people know :), programmers to help me out are more than welcome!
Regards
Steven
Ionic’s ISAPI Rewrite Filter –
http://cheeso.members.winisp.net/IIRF.aspx
free. Regular Expressions. Redirects, Rewrites. RewriteCond. checkitout.
There are also a few rewriting options from within ASP.NET, although they’re not great. I’ve written up an overview of what you can do here:
http://philisoft.com/blog/url-rewriting-in-iis/
I ended up using Ionic’s rewrite filter, works great.
Is this the only way to redirect .htm or .html files on an IIS Server?
Greg Stanley
http://www.flashtoybox.com
You can always use meta refresh tags.
You can also use a custom 404 error page to catch missing urls(Or rewrite urls in this case), and then server.transfer to the correct page, or redirect.
Micronovae has recently released IIS Mod-Rewrite v2.0
http://www.micronovae.com/ModRewrite/ModRewrite.html
This URL rewriting module for IIS is compatible with Apache mod_rewrite, and it’s Pro version is the only solution in the market that supports .htaccess configurations.
For rewrite url, there is Guideman.
http://na-s.jp/Guideman/index.en.html
Microsoft IIS team has released a technical preview of the URL rewrite module for IIS 7.0. This module, when final version ships, will be officially supported by Microsoft. You can get more information about it and download technical preview from here: http://learn.iis.net/page.aspx/460/using-url-rewrite-module/
Hi guys, I have a question: Currenclty I use a 404 pages to perform a basic URL rewriting, that works perfectly so I am asking why there is a such plugins on IIS? Is there a performance issue?
Cheers
02-Oct-2008
Using a 404 pages to perform a basic URL rewriting is Good. But not support 304 Not Modified to increase performance by validation caching.
Can I redirect my /index.php to / using the Ionic’s ISAPI Rewrite Filter? Or is there any easier way to do this ?
I used ISAPI_Rewrite myself. Nice stuff, does a lot. As a result a switched to Helicon Ape – Apache emulator for IIS. It has a rich functionality mod_rewrite, mod_proxy, mod_auth, mod_gzip, mod_headers, mod_cache, mod_expires, mod_developer, mod_replace, mod_so, mod_speling, mod_usertrack and others.
You can have PATHINFO style URLs on IIS. They do not require any components and look reasonably OK. An example of a such URL would is:
http://localhost/app/index.php/products/1234/details
Technically speaking, this is not apache/htaccess style URL “rewriting” but this kind of URL is still better than http://localhost/app/product-etail.php?id=1234 in terms of SEO.
Also, unlike htaccess style rewriting which is almost transparent, this technique requires “coding” changes so that your scripts check for a server variable called “PATH_INFO” instead of/in addition to checking query strings.
IIS does not support URL rewriting itself. Rather, it supports an extension interface called ISAPI which allows add-ons to be installed into IIS.
hi,
I am looking for the example link where there are steps to do the URL shortening via IIS ISAPI. I want the link which has screen shots also so that its easy to understand how it works. does anybody knows about any such links? please let me know if there are any.
As a site owner I believe the subject matter here is reallyfantastic. I appreciate it for your efforts. You should keep it up forever! Best of luck.