Copied to clipboard

Flag this post as spam?

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


  • Kurisotofa 27 posts 75 karma points
    Sep 14, 2009 @ 01:44
    Kurisotofa
    0

    robots.txt created by Xslt

    I need my robots.txt file created dynamically, because of a multi-domainname setup that needs different indexing.

    Using the umbraco.library:RequestServerVariables('HTTP_HOST') function, I succeeded in creating a different a different robots file for each domainname. Using ISAPI Rewrite, I succeeded to redirect robots.txt to the Umbraco robots.aspx page.

    What I don't seem to achieve, is a correct ContentType (which should be "text/plain", isn't it?) output.

     

    I use :

    1. <xsl:output method="text" media-type="text/plain" omit-xml-declaration="yes"/> in the robots xslt-file ;

    2. <umbraco:Macro Alias="mcrRobots" ContentType="text/plain" runat="server"></umbraco:Macro> in the robots template.

     

    An example : http://www.ikwileenserre.be/robots.txt

     

    Any other suggestions?

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Sep 14, 2009 @ 20:20
  • Jonas Eriksson 930 posts 1825 karma points
    Sep 12, 2010 @ 14:30
    Jonas Eriksson
    0

    Did you get your robots.txt working? I guess you needed to setup a handler for the .txt extension also, right?

Please Sign in or register to post replies

Write your reply to:

Draft