Redirects and friendly URL’s have been required in almost every project I have ever worked on. Whether it is to handle legacy URL structures or new marketing initiatives URL manipulation is a must.
Here is a quick guide to show how simple it can be to implement in SDL Tridion using the IIS URL Rewrite extension.
- Install the IIS URL Rewrite extension on your content delivery server(s) (plan this install through environments to avoid delay’s later)
- Create a simple new Schema “URL Rewrites” to allow editors to create rewrite rules with a required text field for from address and to address (Optionally add a description field to make it easier to maintain the URL’s going forward)
- Update your Web.Config to include a rewrite section as below (I prefer including the rules outside of Web.Config to avoid unexpected Application Pool recycles)
- Create Component Template (using Razor Mediator, including forced redirect to HTTPS)
- Create Page Template (using Razor Mediator)
- Create test Component and Page (preview Page to check templates are working and outputting in the correct format)
- Publish Page
- Restart the Application Pool
- Test