Any plans to rewrite outbound links?

Topics: Developer Forum
Apr 5, 2010 at 12:00 PM

Once you get your head around regular expressions, this is an excellent product.

I was wondering if you had any plans to add functionality which could rewrite outbound links? The rewrite module in IIS7 has the functionality to rewrite outbound links within the content of pages (see for an example) but some of us are still in the dark ages and using Server 2003.

Apr 5, 2010 at 3:16 PM
Edited Apr 5, 2010 at 3:21 PM

Hello, mparter!

I'm glad you like IIRF.

Regarding outbbound rules, there's been a similar request already - see workitem 23532.  I haven't prioritized that one.

Your request is slightly different than that one.  That one is strictly focused on rewriting Proxy content, while yours is more general.  While your idea is pretty simple in theory, it would require a re-work in the basic design of IIRF.  For that reason I think it's impractical at this time.

IIRF is based on the older model of IIS extension, which is why it's called an ISAPI Filter.  In IIS7 Microsoft introduced a new mechanism or model for extending IIS, simpler and more generalized. But it doesn't work for older IIS, such as IIS6 on WS2003. Conversely, ISAPI filters can run on IIS5,6,7 and so on. 

Any ISAPI Filter is able to interject itself into the HTTP request, and modify the headers for that request.  Likewise, an ISAPI Filter is able to modify the outgoing response headers as well.  A filter is not able to modify the full request data - let's say, data that gets sent with a post request - nor is it able to modify the full response data - such as the text of an HTML pages.  A filter, really, can only manipulate headers.

Your suggestion regarding outbound rules would require modification to the outbound response data, which is just not possible in an ISAPI Filter.  It is possible if the tool is not an ISAPI Filter - for example if it is designed to use the new-for-IIS7 extension model.  But obviously, that prevents the thing from running on IIS6.

It would also be possible to build something that works on IIS6, and also is able to modify outbound requests - it would have to be what's called an ISAPI Extension.  But that change would require a pretty fundamental re-design of the way IIRF handles requests.  It would have to interject itself into every request and every response coming into IIS.  While possible, this is the sort of change that would require lots and lots of testing before I'd be able to release it.

So, for now I think the idea is interesting, but impractical. 


Apr 5, 2010 at 3:33 PM

Hi Cheeso. These things always appear simple on the surface but the practicalities usually fall away once you roll your sleeves up. I'm more than happy with what you've built does just now and there are other ways to handle the outbound rewriting, would be cleaner to have it in one solution that was all.

Thanks, Mark

Apr 5, 2010 at 4:58 PM

I read the link you provided, and I'd agree it should be left to another project.  The leap from rewriting request and response headers to rewriting the full request data is a *big* change.  It seems like there are plenty of other approaches to solve it as well.


Dec 9, 2010 at 8:09 PM
Edited Dec 9, 2010 at 8:12 PM

This is definitely a valid feature. Is there any update or final word on any roadmap to add this functionality? Whether it needs to be two products or one is irrelevant (to me), but it does make sense (to me) that you guys look into outbound redirects for < iis 7 to compliment the IIRF tool you provide.

To be clear .. the requested functionality would allow filtering of outbound URLs (e.g. rewrite, redirect) - I don't believe this is directly related to reverse-proxy... Or does anyone know of such an IIS6 filter.

Dec 14, 2010 at 1:21 PM

I think what you want could be a reasonable thing to do.  I don't think it belongs in IIRF as a feature.  I don't know of any products out there that provide this feature.  

Depending on your requirements, you could write this yourself as a relatively simple ISAPI extension (not a filter); or, you could commission someone to build it for you.  In either case you'd have to get very specific about exactly how the feature would work. Sometimes just going through this sort of effort will lead you to an alternative solution that you hadn't seen before.

From your description, if you want the thing to examine outbound responses - it would have to interject itself into every IIS request, and check them against a set of rules or configuration.  This will introduce some challenges with respect to concurrency and threading, as well as performance.