Helping people with computers... one answer at a time.
URL Rewriting is a powerful way for webmasters to control what a URL really represents. IIS requires an extension in order to support url rewriting.
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.
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:
Comments on this entry are closed.
If you have a question, start by using the search box up at the top of the page - there's a very good chance that your question has already been answered on Ask Leo!.
If you don't find your answer, head out to http://askleo.com/ask to ask your question.