Getting Sitecore 404 for physical files

2019-02-27 05:03发布

The media library URL (/sitecore/shell/Applications/Media/MediaShop/default.aspx) is being picked up by the SiteCore handler and redirected to the page-not-found page Sitecore uses (/sitecore/service/notfound.aspx). The file is a physical file and is actually there. I've seen things like this happen with items in the Sitecore content tree, but not with physical files. Any ideas where to look would be appreciated. Thanks.

Update: So, the issue as described above is fixed, but it's clear that there are other problems, seemingly also media related. This file: /sitecore/shell/applications/media/mediafolder/mediafolder.js is showing the same symptoms I've described above. They file is there on the server, but Sitecore is redirecting to it's 404 page.

3条回答
SAY GOODBYE
2楼-- · 2019-02-27 05:55

I apologize if this is patronizing, but I'll post it anyway in case it helps.

Have you registered the path to be ignored in the "IgnoreUrlPrefixes" setting? I don't see that anyone has mentioned that, but perhaps that's because it's obvious.

<setting name="IgnoreUrlPrefixes" value="/sitecore/shell/Applications/Media/MediaShop/default.aspx" />
查看更多
戒情不戒烟
3楼-- · 2019-02-27 06:01

It looks like the physicalFolder attribute of your sites configuration is not set properly.

 <site 
    name="helloworld"
    hostName=www.helloworld.com
    virtualFolder="/virtual"
    physicalFolder="/hello" 
    rootPath="/sitecore/content"
    startItem="/Hello Home"
    language="en" 
    database="web" 
    domain="extranet" />

Double check if this parameter for the site is set properly. According to the Sitecore documentation, the files stored in the physical folder always take precedence over the Sitecore Items. Here are some details about the physicalFolder part of the sites config:

site Attribute Properties: physicalFolder

If it's not a problem with the sites configuration you may try to put a txt file or an image in the same directory and check whether Sitecore serves them properly.

查看更多
We Are One
4楼-- · 2019-02-27 06:06

Ok...here it is: Found this line in the web.config:

<handler trigger="/media/" handler="sitecore_media.ashx"/>

Which should be this:

<handler trigger="~/media/" handler="sitecore_media.ashx" />

After I made that change, everything worked great.

查看更多
登录 后发表回答