Skip to content

Controllers

Tom van Enckevort edited this page Feb 23, 2022 · 2 revisions

There are a few controllers in this package that deal with some common routes.

Namespace: HappyPorch.UmbracoExtensions.Core.Controllers

RobotsController

Handles the /robots.txt requests, and it will either return the content of the robots.txt file in the root of the website or, if that doesn't exist, it will create the content of the robots.txt file on-the-fly and include the sitemap URL based on the request URL's domain.

SitemapController

Handles the /sitemap.xml requests, and it will return the XML sitemap for the site. This will be created on-the-fly and includes all the pages of the site (either all nodes if it's a single site, or just the current site's nodes if it's a multi-site site Umbraco instance). Pages that have their HideInXmlsitemap property set to true will not be included, nor will pages without a template (i.e. things like settings nodes).

Clone this wiki locally