Alternate URLs in SDL Tridion 2011

Why?

Clients often ask about how they can configure alternate URLs for the Pages they manage in SDL Tridion. Normally I tell them it’s entirely possible, and talk a bit about how it would be handled. In a .Net environment, I explain, we’d likely use an HttpModule that queries a data source to find a matching target URL for the requested URL. This data source might be an XML file, or it might be a DB such as the Content Broker.

How?

My personal preference has always been using the Content Broker to handle this. The alternate URL information can be stored as metadata for the appropriate Page. This metadata is then available for query in the Content Broker. Nice and simple really – a request comes in, it’s checked against the metadata in the Broker, if a match is found we redirect to the target Page, otherwise the request continues as normal.

I won’t go in to the full technical details as the code can speak for itself. Follow the link below to the Tridion Practice site to find the code and documentation.

When?

That’s a very good question. Building this has been on my todo list for quite some time now (I have an email containing relevant information in Inbox from Septermber 2009!) but for various reasons have never found the time to put it together. Fortunately, in relation to an upcoming POC, I was able to find the time this week. Apart from some issues getting the module to trigger for requests without a file extension it was as easy as I’d suspected.

Where?

You can find the documentation and the source code on the Tridion Practice site. Feel free to post any questions on here if you have any.

Advertisements