Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jesper Skjønnemand 31 posts 255 karma points
    May 21, 2019 @ 10:53
    Jesper Skjønnemand
    0

    change robotstxt to robots.txt

    I have created a simple Document Type for text files in order to create a robots.txt. This works very well. However, my node named robots.txt renders as /robotstxt (without the dot) in the URL, hence it is useless to crawlers. I wonder if there is a simple way to render the URL as robots.txt (with the dot) ?

    All the best

  • Jesper Skjønnemand 31 posts 255 karma points
    May 21, 2019 @ 10:54
    Jesper Skjønnemand
    0

    Someone mentioned ~\Config\UrlRewriting.config but no such file seems to exist in my local clone.

  • Bo Jacobsen 294 posts 1282 karma points
    May 21, 2019 @ 12:37
    Bo Jacobsen
    1

    Hi Jesper.

    If no such file exsist then i guess you are using Umbraco version +7.6?

    Then you use the web.config rewrite rules.

    <!--
      If you wish to use IIS rewrite rules, see the documentation here: 
      https://our.umbraco.org/documentation/Reference/Routing/IISRewriteRules
    -->
    <!--
     <rewrite>
      <rules></rules>
     </rewrite>
      -->
    
  • Magnus Eriksson 102 posts 240 karma points
    May 21, 2019 @ 19:03
    Magnus Eriksson
    100

    Best option would be to use URL Rewrite module in IIS. That rule would look like:

    <rule name="Robots" patternSyntax="Wildcard" stopProcessing="true">
      <match url="robots.txt" />
      <action type="Rewrite" url="/robotstxt" appendQueryString="false" />
    </rule>
    

    Regards, Magnus

Please Sign in or register to post replies

Write your reply to:

Draft