What I’m trying to do is create (or perhaps one already exists) a HTTPHandler that will filter the HTML generated ASP.NET to use the content delivery network (CDN). For example, I want to rewrite references such as this:
/Portals/_default/default.css
to
I’m perfectly happy using RegEx to match the initial strings. Such a regex patterns might be:
href=['"](/Portals/.+\.css)
or
src=['"](/Portals/.+\.(css|gif|jpg|jpeg))
This is a dotnetnuke site and I don’t really have control over all the HTML generated so that’s why I want to do it with an HTTPHandler. That way the changes can be done post-page generation.
You could write a response filter which can be registered in a custom HTTP module and which will modify the generated HTML of all pages running the regex you showed.
For example:
and then write a module:
and register in web.config: