Hi Shane, There are many answers to this question so bear with me. If you are wanting to re-direct from a .HTM extension then you would need to assign that extension to ASP.Net to get a DNN module to recognize it. This is not the most optimal thing to do but it is possible. If you have control of the server and you want to keep from mapping .htm files to the ASP.Net pipeline you can use an ISAPI filter. http://www.isapirewrite.com/ is a good one for this purpose that gives you all the flexibility of the Apache mod-rewrite. In IIS7 Microsoft has taken us closer to the Apache world and is making it possible for developers to plug-in ASP.Net HttpModules to the IIS system. What this means is that you won't need to have control of the server to do what the ISAPI Rewrite filter does now.
Ok, back to the code above. It is something that you can paste into an ASP.Net page (.aspx), or an ASP.Net User Control (.ascx).
The main drawback is that it will not work with .htm extensions unless the Asp.net application mapping mentioned earlier is configured in IIS. Last, but certainly not least, my PageBlaster module will have this functionality in the near future. |