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.
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?
Try this (ofcourse use text/plain):
http://our.umbraco.org/wiki/reference/umbracolibrary/changecontenttype
Did you get your robots.txt working? I guess you needed to setup a handler for the .txt extension also, right?
is working on a reply...