Tuesday, August 30, 2005

[tech] mod_Rewrite for IIS

mod_Rewrite is such a smart feature. Fortunately there is a way to get it in IIS too (http://www.isapirewrite.com/) Here is sample usage right from the ISAPI Rewrite site:
[ISAPI_Rewrite]
RewriteRule /doc(.*)\.htm /XMLProcess.asp\?xml=$1.xml

Now to access documents use URL like http://www.mysite.com/doc/somedir/somedoc.htm. Search engines will never know that physically there is no somedoc.htm file and content is dynamically generated.

How cool is that?

Later I learned that you can achieve the same effect by creating a customized 404.asp. Options = Good.