Skip to content

Instantly share code, notes, and snippets.

@Swimburger
Last active September 20, 2019 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Swimburger/07a7234b7a424b9165aeca7d61a61e73 to your computer and use it in GitHub Desktop.
Save Swimburger/07a7234b7a424b9165aeca7d61a61e73 to your computer and use it in GitHub Desktop.
Dynamic Robots.cshtml robots.txt file for Umbraco, learn more at https://swimburger.net/blog/umbraco/crawling-through-umbraco-with-robots
@inherits UmbracoTemplatePage
@{
Layout = null;
umbraco.library.ChangeContentType("text/plain");
var rootUrl = Request.Url.GetLeftPart(UriPartial.Authority);
}Sitemap: @string.Format("{0}{1}", rootUrl, "/sitemap.xml")
User-agent: *
Disallow: /umbraco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment