-
Book Overview & Buying
-
Table Of Contents
Sitecore Cookbook for Developers
By :
Sitecore provides the LinkProvider class, which contains different properties to achieve different URL patterns such as adding a .aspx extension, location of language, language embedding, lowercase URLs, and so on. The LinkManager in Sitecore can contain multiple LinkProviders (multiple URL patterns), and any one LinkProvider can be set as the default. The URL configuration set in the default link provider will be applied to all the sites' URLs.
Consider a case where you are working on a multisite solution, and different websites need different URL patterns. One site is built with a single language, so its URLs will not contain language information; other multilingual sites may need language as filePath or queryString. In this recipe, we will allow the Sitecore solution to apply a website-specific URL pattern by creating a custom LinkProvider.
Let's first configure multiple URL configurations (link providers):
In...