Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi guys,
I'm building a site for a client who has quite specific requirements around being able to edit their Robots.txt file (amongst other things).
I've been following this really handy article by glcheetham https://glcheetham.name/2016/10/02/robotstxt-umbraco/
However I obviously come across issues when it comes to rewriting the URL to handle the file extension as UrlRewriting.config no longer exists.
Does anybody know of an alternative way to do this or better yet an IIS Rewrite rule I can use instead that will achieve the same result as this.
<add name="robots-rewrite" virtualUrl="^~/robots.txt" destinationUrl="~/robotstxt"/>
Apologies if this a simple query, my rewrite skills are not the greatest :)
The rule would be something like
<rule name="robots.txt"> <match url="^robots.txt$"/> <action type="Rewrite" url="~/robotstxt" /> </rule>
The "^" in url means "start of input", and "$" is end of input. The url is everything between the first "/" and first "?" in the url. This will then match http://site.com/robots.txt, but not http://site.com/robots.txtandmore
HTH :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Robots.txt edit in CMS - URL rewrite to handle file extension?
Hi guys,
I'm building a site for a client who has quite specific requirements around being able to edit their Robots.txt file (amongst other things).
I've been following this really handy article by glcheetham https://glcheetham.name/2016/10/02/robotstxt-umbraco/
However I obviously come across issues when it comes to rewriting the URL to handle the file extension as UrlRewriting.config no longer exists.
Does anybody know of an alternative way to do this or better yet an IIS Rewrite rule I can use instead that will achieve the same result as this.
Apologies if this a simple query, my rewrite skills are not the greatest :)
The rule would be something like
The "^" in url means "start of input", and "$" is end of input. The url is everything between the first "/" and first "?" in the url. This will then match http://site.com/robots.txt, but not http://site.com/robots.txtandmore
HTH :)
is working on a reply...