Sitecore determines the default URL for an item based on its path; for instance the default URL for /sitecore/content/home/hr/jobs is /hr/jobs.aspx. In some cases it is useful to have shorter URLs which map to longer paths, for instance /jobs.aspx may be preferable for marketing materials (email campaigns, print advertisements, etc.). Sitecore supports alternate URLs through a feature known as aliases.
Creating Alias to an item
It is very simple to create an Alias for the Item. All you have to do is, log on to Sitecore admin control panel. In the Sitecore tree, go to System -> Aliases, and click on the Alias in the options section. Provide the name of the alias as shown in the below screen capture. Click on the Ok button to save the alias.
Once the alias is saved, you can see the Sample alias under Aliases folder. Click on the Sample item to see the properties. In the properties section, go to Data section and click on the Insert link button.
In the insert link popup window, select the item you want to create an alias for, in this case, I am selecting the item Home -> Sample Item -> Sample Item as shown in the below screen capture and click on the Insert button on the popup.
Finally save all the changes.
That’s all. You have created an alias Sample for the content item Home -> Sample Item -> Sample Item.
Sitecore first checks the aliases before trying to render the page.
If you have multiple sites hosted on a single Sitecore instance, remember, the same alias is applicable to all the websites.
The same content will be served with two different URLs, I.e. the original item URL and the alias. In the above case, you can browse the page with item URL /Home/Sample Item/Sample Item and /Sample. This might sometimes cause confusion for search engines to index the pages. Someone might use the original item URL and some other might use the alias, google will index both the pages and find duplicate content which might have impact on the page rank.
Implementing Aliases in Multi-Site environment
In multisite environment, we can still use this functionality. We can customize the AliasResolverprocessor in HttpRequestBegin pipeline, where the alias items will be stored in Site specific folder, so, the Custom AliasResolver will search aliases in site folder only. We can create a alias folder structure site-wise, something like,
Sitecore by default provides Item Aliases for single language. Here we are going to check that when a request come for an alias, the content of the Linked Item should come with selected language.
In the Alias template (/sitecore/templates/System/Alias), add a new field Linked Language with DropLink field.
So, when a request comes like http://domain/idioma/, it should serve the Products page with es-ES language.