Problem:
You have Images or Videos directories on the file system, but files from them are not served - an error 404 is generated.
Cause and Solution:
Let's take the Images directory for example. Everything said for it is valid for the Videos as well:
Images is the default root mapping for images stored in Sitefinity’s Media module. In version 4.1 the Sitefinity’s virtual paths cannot match with physical paths for Libraries. This is necessary for performance reasons. To avoid this conflict you have to rename the physical folder or change the virtual root in Libraries configuration.
To change the configurations please go to: ~/Sitefinity/Administration/Settings/Advanced>Libraries>Images>UrlRoot and change the value to something like sf-images.
All items that existed before the change, should be updated to use the new UrlRoot. This can happen with the execution of the following code:
var imagesFacade = App.WorkWith().Images();
imagesFacade.ForEach(
img =>
{
((IContentManager)imagesFacade.GetManager()).RecompileItemUrls(img);
}
).SaveChanges();
We have prepared a .aspx page that can be placed in the web site root - it contains a button which performs the operation above. You may find it attached to this KB article.
Depending on the number of request or proposed ideas, we might change the UrlRoot for the default Libraries modules in the upcoming versions.