Add a non-orchard page at the root

Topics: Administration
Feb 23, 2013 at 8:17 PM
I configured orchard to sit at the root of my domain, but now I need to be able to serve a page at the root that isn't part of orchard in order to configure google search and analytics. For example, http://www.mydomain.com loads the default orchard page. http://www.mydomain.com/mypage.htm yields a 404. I need it to return the page sitting in wwwroot. Is this possible to configure?
Coordinator
Feb 23, 2013 at 9:51 PM
Orchard's web.config is locked down by default. You need to go in there and allow htm files explicitly and have it served by the static file handler. This is IIS configuration for which you can find documentation on MSDN.
Feb 26, 2013 at 4:12 AM
Excellent tip! Thanks for your help Bertrand.

When I added the StaticFileHandler for .htm files, Orchard lost its styles. I added a second instance of the StaticFileHandler with a different name to handle .css files and everything is looking great. My changes to the web.config looked like this:
<handlers accessPolicy="Script">
      <!-- clear all handlers, prevents executing code file extensions, prevents returning any file contents -->
      <clear />
      <!-- Return 404 for all requests via managed handler. The url routing handler will substitute the mvc request handler when routes match. -->
      <add name="static1" path="*.htm" verb="GET" type="System.Web.StaticFileHandler" resourceType="File" />
      <add name="static2" path="*.css" verb="GET" type="System.Web.StaticFileHandler" resourceType="File" />
      <add name="NotFound" path="*" verb="*" type="System.Web.HttpNotFoundHandler" preCondition="integratedMode" requireAccess="Script" />
    </handlers>
Thanks again for your help. I appreciate you taking the time to answer noob questions.