Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The UrlListModule provides the facility for url management, redirecting urls and changing the 'natural' url of a content item to an arbitrary url. It provides for a section in the editor to manage urls for every relevant content item. It also manages generation of canonical urls.

Setting up the url list module

The url list module requires registering the special UrlListRoute at the top of the routing table, e.g. in RouteConfig.RegisterRoutes, at (or near) the top:

 

routes.AddUrlListRoute("other urls");

 

Configuring the Url List module

The url list module has the following settings:

  • AlwaysUseCanonical: insert a rel=canonical link into every page, even if the url of the page is the canonical url
  • DefaultCanonicalDomain: the domain name of the default domain to use for generating canonical links (e.g. www.awebsite.com)
  • UseHttpAlways: if true, always use http: at the beginning of the domain, if false, always use https:, if null use the same as the current request
  • SafeReload: if true (the default), when reloading the cache, retains the old cache in memory alongside the one being reloaded and only switches them when loading is done.  Set false to save memory.

Ensuring a content type can have a url list

To have a url list, a content type must implement IHasAlternateUrls.  A possible way to ensure that is if it inherits from PageWithUrlsContent (which in turn inherits from PageContent).

The Url List editor section

The image below shows the url list editor section when opened. You can add or delete a url as normal with a list editor.  The url itself is entered, then a selection is made from:

  • Main: This can only be selected once in the list.  When this is selected, the primary url to access the content item is the given one, not the 'natural' one given by the data route template. Within Lynicon, references to the url of the item will return the primary url.  While it is still possible to view the content item on the 'natural' url, the page markup has a canonical link to the given url.
  • Canonical: The page can be accessed additionally on the url supplied, however it has a canonical tag pointing to the 'natural' url
  • 301: Accessing the url listed results in a 301 redirect to the natural url
  • 302: Accessing the url listed results in a 302 redirect to the natural url

 

image

  • No labels