I wanted to write a technical analysis on how to use aliases out of the box functionality in Sitecore and how to add the ability to use multi-site aliases.
Aliases is a way to create very short urls for content, some kind of shortcuts.
What we need to do
- We need to have aliases for each site.
- We need to configure the location where we’ll store aliases for each site.
Configuration in Sitecore
Instead of having our aliases stored under “/sitecore/system/Aliases” folder, we can define a folder for each site where we can put our aliases.
We’ll put Aliases folder under /sitecore/content/<
Under this aliases folder we can create subfolders where editors can group the aliases. We can let it just free for editors to add folders there. This is useful if we’ll have a huge number of aliases.
For a specific item we can create an alias for it through this aliases sitecore user interface(Content Editor -> Presentation Tab -> Aliases):
Having multiple URLs for an item can reduce Search Engine Optimization (SEO) value. However we can to avoid that by implementing a canonical URL in the head, to ask the search engine to index the real url instead for the aliases.
- Editors should create aliases that have unique name.
- Editors should not create aliases that have the same name as content at the first level of hierarchy.
- Aliases generally do not improve performance, so editors should limit their use.
We need 2 things:
- Modify the way how Sitecore is resolving the aliases by going to the aliases folder under each site.
- Modify the way Sitecore is saving the aliases to point it to the specific folders.
We can rewrite the Sitecore.Pipelines.
<processor patch:instead=”processor[@type=’Sitecore.Pipelines.HttpRequest.AliasResolver, Sitecore.Kernel’]”
type=” <Your Namepace>.AliasesResolverProcessor, <Your DLL name>”/>
I will create another post for that to show possible strategies to deal with Aliases instead of Sitecore Database.Aliases out-of-the-box.
We’ll create a dossier in the common project under Sitecore/shell/
In that class we need to create methods that we’ll need instead of the default actions: Add_Click , Remove_Click
For instance we need to modify a behavior like the default behavior. We should change this method and make it link to where we store our aliases for each site. I will create another post for that to go further in details.
We should also modify the dialog xml (sitecore\shell\Applications\
<CodeBeside Type=”<Namespace>.AliasesForm,<Dll name>”/>
Configuring access to Aliases
In order to limit the use of Aliases, access rights can assist with that objective.
However if we’ll move the aliases folder and put it in each website, probably we’ll need to modify the access rights for the new personalized folders. For the default location under “/sitecore/system/
If we want to really limit the use of aliases we need to allow the rights maybe per user and not per role.— June 1, 2016