The best / easiest way would be to do it the way we always did, with an HTTP module that intercepts requests. Install it in the GAC via WSP and make changes to web.config through the function receiver - make sure that the function is defined with the scope of the web application.
, "/pages" URL- Microsoft. , , URL-, "/pages/whatever.aspx", .