David
Wed May 03 05:11:43 CDT 2006
You can write an ISAPI to buffer and parse all outgoing response to do the
substitution.
The reason it does not "automatically" work is simple - IIS is an HTTP web
server, not an HTML server. It does not care about the content (such as your
hrefs), only that it should send it to the client.
IIS parses HTTP requests and sends them to handlers to handle, and then send
the handler's response back to the client via HTTP. It has no reason to
read/parse that content - why should IIS care that you have an href to
server1 or localhost or anywhere else? It's the client that parses the HTML
received via HTTP; server just sends the data blob via HTTP.
Your ISAPI is running alongside the web server processing and logically
rewriting the URL; it makes logical sense that such an ISAPI should also
read/parse the output if it is HTML to rewrite URLs if it needs.
--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Francesco Taglialatela" <francesco.taglialatela@zucchetti.com> wrote in
message news:eT1Ps4obGHA.3840@TK2MSFTNGP04.phx.gbl...
> Hi guys,
> I have a question about URL Rewriting and I can't find an answer in the
> past posts.
> I have to set up an URL rewrite system on a web site, something easy like
> this:
>
>
http://localhost/mypage.asp?categoryname=testcategory&productname=testproduct
>
> I have to rewrite it as follow
>
>
http://localhost/testcategory/testproduct.htm
>
> Nothing hard: using an ISAPI filter (regular expression driven) everything
> works fine.
> But... is it possibile to make the rewrite work in the href contained in
> the HTML returned to the client?
> I mean, if I have a link like this in mypage.asp, why it doesn't become
> rewritten?
>
> <a
> href="
http://localhost/mypage.asp?categoryname=testcategory1&productname=testproduct1">mylink</a>
>
> doesn't automatically become
>
> <a href="
http://localhost/testcategory1/testproduct1.htm">mylink</a>
>
> There's a way of doing that with an ISAPI without rewriting all my links
> manually?
>
> Thanks a lot.
> Francesco
>