Setting up Sitefinity to forward old Urls to new Urls
My colleague Adam Duggan pointed me to an incredible useful post on the Sitefinity support forums: http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-bhamhe.aspx. I mistakenly believed that Sitefinity would support redirecting .ASP files to the new .ASPX counterparts as long as IIS had the .ASP extension associated with the aspnet_isapi.dll runtime. WRONG! As indicated in the forum posting by Randy, the following steps are required:
Step 1: Configure IIS
What happens if you request a non-existent HTM,ASP page?
By default you will get a canned "white page". When you install the .NET Framework is maps certain file extensions to the ASP.NET ISAPI, aspnet_isapi.dll. Neither HTML nor HTM files are mapped to it (because they are not ASP.NET pages). However, you can configure IIS to treat them as ASP.NET pages and serve our custom error pages.
Run the IIS Manager
Select a web application
Right click and go to Properties
On the Virtual Directory tab click Configuration
In the Extension column find .aspx, double click and copy the full path to aspnet_isapi.dll. It should be something like C:WINDOWSMicrosoft.NETFrameworkv2.0.50727aspnet_isapi.dll
Click Add and paste the path in the Executable box
In the Extension box type .html
Make sure Check that file exists is NOT checked
Dismiss all dialogs
Step 2: Modify Web.Config
Add as many types as you want into the httphnadler section of your web.config.
Step 3: Set Default Page Properties
- Open Sitefinity Admin
- Open the Contact.aspx file.
- Click Properties
- Expand More Options
- Add another URL (~/Contact.htm)
- Check the “Redriect to Default URL” box
- Save Changes.
Step 4: Write code using Telerik API
Add this bit of code to your global.asaxNow if you come to the site with contact.htm and it doesn’t exist, you will be redirected to contact.aspx.
I hope this helps
A huge thank-you to Randy for not only figuring this out, but posting the results!