5

What is the best way to create SEO friendly urls in Tridion? How do we publish and unpublish the main page as well as its vanity urls at the same time?

The main requirement from the business is to have the least IT involvement. Eg: The want to have a marketing campaign - my-long-url is mapped to my-vanity-url. Once they unpublish they want both the long and the vanity url to be unpublished. Their current problem is that they get to unpublish the long url (page) and the redirect mapping still has to be removed by IT from the Apache settings. This is what they wanted to avoid.

2
  • 4
    There are a number of options available. What research have you done yourself? Commented Apr 8, 2013 at 0:26
  • The main requirement from the business is to have the least IT involvement. Eg: The want to have a marketing campaign - my-long-url is mapped to my-vanity-url. Once they unpublish they want both the long and the vanity url to be unpublished. Their current problem is that they get to unpublish the long url (page) and the redirect mapping still has to be removed by IT from the apache settings. This is what they wanted to avoid. Commented Apr 8, 2013 at 15:06

5 Answers 5

7

There are a number of ways to do this and the approach largely depends on your application architecture. Are you using Spring, Struts, .NET MVC3, Code Igniter, plain HTML, etc? All have similar but different mechanisms to map URLs to controllers/pages.

The easiest way is to configure the vanities outside of Tridion on your web server (e.g. create mod-rewrite rules).

If you're using DD4T or an MVC framework, you need to create a mapping of Vanity URL to Tridion page URL. This mapping may depend on a number of business rules which are custom to your company.

Another way is to have a Vanity URL field in a Tridion page metadata schema and upon page save, trigger an event that checks if this URL is unique within Tridion and save it to a component tracking all the vanities in Tridion. Upon publishing of the page with this component, a custom deployer would update the .htaccess file with the mod rewrite rules listing out the vanities.

7

Here question does not have sufficient information to suggest you best. So I am expecting an update in question from your side. Sometimes it is always recommended to think first that how you can best achieve it in your technology (ASP.NET or Java) first and then comes at the Tridion side.

So if you are using ASP.NET and II7 it can be achieved through the rewrite module. You may have a look here -

http://learn.iis.net/page.aspx/469/using-rewrite-maps-in-url-rewrite-module/

You can also achieve same thing programmatically in global.asax by checking where you are and where you wish to go. For this you will have to write your code inside the Application_BeginRequest event in the global.asax file.

So far I have suggested you the ways to achieve it in your application technology (assuming ASP.NET). Now come at the point that how you can manage this all in Tridion. So for this you can create an event system which will insert the values in a file when pages are saved. You can then publish this file periodically and use it to look up the actual URLs and map them to vanity URL.

Again if you are using IIS7 you can publish this file in the form of particular web.config section and reference it in your web.config by using the ConfigSource attribute.

6

If your WAS is IIS, and you are working in .NET environment, then you may use HttpHandlers and IIS URL re-write to achieve the functionality. You can create the URL Hierarchy in Tridion by having the appropriate Structure Group Hierarchy and publishing them as is and then handling the mapping and rewriting using HttpHandlers and IIS at the run time.

I hope it helps.

6

As Nickoli says, your question needs further background information before it can be answered properly. It is difficult to answer questions with such a large scope (with no technology, constraints, scope, scale, etc. given).

I would suggest that you think about exactly what you are trying to achieve here. There is a big difference between SEO friendly and vanity URLs!

It is possible to achieve SEO friendly URLs using the standard Tridion Structure Group hierarchy if you name your Structure Group directories sensibly and use URL best practice.

Vanity URLs should be used to provide addresses that are easy for a user to recognise and type, rather than as an SEO strategy. As long as you have a logical hierarchy** to your Structure Groups within Tridion, and a good naming convention for you directory structure on the file system (hyphen-separated and all lowercase maybe), then the SEO should look after itself.

**There may be some circumstances where your Structure Group hierarchy does not represent the logical structure of your site, but I'll assume that this isn't the case here

1

Firstly you haven’t really given us enough information – are you using plain HTML, Struts? Strings? Or other mechanisms? This information is important to using Tridion. Once you let us know what that is, it will be easier to configure you vanity URL, but for now the best first step will be to look to making mod-rewrite rules through your web server.

The way I always tend to do it is by triggering an event through your metadata Schema and check if the URL is unique within Tridon. When prompted you can then update the .htaccess file and rewrite the unique HTML.

Without further information about what system you are using and what you company’s rules are, I cannot really help more than that.

2
  • Hi Charles. Welcome to Tridion stack exchange. I see that there are two main strands to your answer: first you ask questions to help the questioner improve their question, and then you give your actual answer. If fits the format here better if you do the first of these as a comment on the question itself. Then your answer can focus on your mod-rewrite suggestion, and people can vote on it as such. It also saves you from having to update your answer as the question itself gets improved. Hope this helps. Commented Jan 15, 2016 at 15:59
  • Having said that - all the other answers begin in a similar way... :-) Guess the question /really/ needs work Commented Jan 15, 2016 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.