This project is read-only.

Problems with StaticFileModule in Web.config. Can't load styles, images on pages.

Topics: Installing Orchard, Troubleshooting
Aug 21, 2011 at 10:20 AM
Edited Aug 21, 2011 at 10:31 AM

I've just set up a Shared Hosting on IIS7 (managed with WebsitePanel), copied the files just like in the instructions. All is well, installation went successfully, however, throughout the entire process, I've been viewing non-styled pages with pure HTML, with no CSS or images loaded.

When I looked at the URL of the unloaded images or styles, I got a 500 page:



500 - Internal server error.

There is a problem with the resource you are looking for, and it cannot be displayed.



I was able to browse the directories right until the one containing the resources which couldn't be loaded. They all contained practically the same Web.config file, which determined the handlers for resources.


      <!-- iis6 - for any request in this location, return via managed static file handler -->
      <add path="*" verb="*" type="System.Web.StaticFileHandler" />
    <handlers accessPolicy="Script,Read">
      iis7 - for any request to a file exists on disk, return it via native http module.
      accessPolicy 'Script' is to allow for a managed 404 page.
      <add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />

I decided to delete the element from <handlers> (for iis7). It worked. I was able to access the resources properly, but I didn't have to do that when running from WebMatrix, so then I reverted the config. So it definitely has something to do with StaticFileModule. I want to fix this problem server-wide, can anybody please point me to what I should do?

Aug 22, 2011 at 8:27 PM

Can you give more details about the error?

Aug 23, 2011 at 3:03 PM

It was me who wrote the question (had a cookie from another account, didn't notice).

It isn't quite an Orchard issue, I just thought that someone else might have encountered this problem with other hosting services.

Anyway, I played with the whole setup for a while. I talked with both the hosting support staff who advised that I re-create the website, which I did. I never actually changed anything, but the second time it worked. Can't explain it, however here's what the folks at ServerFault wrote:

Unfortunately I haven't had the chance to actually test the solution. I turned off the customErrors, but was still getting a simple 500 error page. If anyone else stumbles upon this problem, I hope this helps.

Thank you for your attention.

Aug 23, 2011 at 7:36 PM

Yeah, I've actually seen that happen before, with a similar resolution. I'm still quite puzzled by it.

Sep 17, 2011 at 10:54 PM

If you're using Arvixe hosting, then make sure you uncheck "Enable Parent Paths" for the website. 

I fought this for 2 hours...