How to let Orchard server a text file in the root folder

Topics: General
May 8, 2014 at 10:54 AM
Hi,

I'm absolutly new to orchard, so please forgive my possibly odd question.

I have a txt file which should be server under


www.server.com/textfiletoserve.txt

How could i possibly do that with orchard?

Thanks for any suggestion
May 8, 2014 at 11:22 AM
zn00p wrote:
Hi,

I'm absolutly new to orchard, so please forgive my possibly odd question.

I have a txt file which should be server under


www.server.com/textfiletoserve.txt

How could i possibly do that with orchard?

Thanks for any suggestion
I'll come back to you when my solution finally loads ;p
May 8, 2014 at 11:30 AM
In your Web.config add the following (example) under <system.webServer> / <handlers accessPolicy="Script,Read">

<add name="RobotsTxt" path="robots.txt" verb="*" type="System.Web.StaticFileHandler" preCondition="integratedMode" resourceType="File" requireAccess="Read"/>

This example would host the robots.txt file directly from your root (Orchard.Web) folder.

Hope this helps!
Marked as answer by zn00p on 5/8/2014 at 7:49 AM
May 8, 2014 at 3:49 PM
Hi,

Thank you.
It worked after I placed it before the 404 handler.