URL Redirection on ASP.Net 3.5
URL rewriting in .Net after version 2010 is as easy as in .Net Framework 4.0 and above with a built-in capability for handling URL rewriting or redirection. Since the version of .Net used in Tridion 2009 is the Framework version 3.5. A global.asax file needs to be created and appended to the web config. By default the Framework 3.5 won't reference the system.web.Routing assemblies. So there is a need to reference the System.Web.Routing assembly to the site. The location of the library is C:\Windows\assembly.
- <assemblies>
- <add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- </assemblies>
- <httpModules>
- <add name="RoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing,Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
- <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- </httpModules>
- <system.webServer>
- <validation validateIntegratedModeConfiguration="false"/>
- <modules runAllManagedModulesForAllRequests="true">
- <remove name="ScriptModule"/>
- <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- </modules>
- <handlers>
- <remove name="WebServiceHandlerFactory-Integrated"/>
- <remove name="ScriptHandlerFactory"/>
- <remove name="ScriptHandlerFactoryAppServices"/>
- <remove name="ScriptResource"/>
- <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- <add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
- </handlers>
- </system.webServer>
Procedure
Comments
Join the conversation! Your thoughts help the community grow.