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 66 posts 441 karma points c-trib
    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 66 posts 441 karma points c-trib
    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 610 posts 2409 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 122 posts 362 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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies