I do not quite get the VirtualPathMappedProvider.
Here's one example of how to use it that I've found:
But when I try it out myself the only thing necessary to get it to work seems to be:
Then I can add:
and whatever other mappings I want and all seems to work out just fine.
So why do I find virtualPath and the other parameters in the examples of how to use VirtualPathMappedProvider?
What do virtualPath do and is it necessary?
Best regards Stefan
I had the same question a while back, and used Reflector on the class. If I recall correctly, the config parameters were stored in a NameValueCollection and then used for precisely nothing at all.I may (likely) have missed something, though...
Just as I thought, thanks Jørgen.
I came across the VirtualPathPageMappingProvider when I did an upgrade from EPiServer 4 to 5, I don't know if it's related but here's some info about it...
In version 4 I had an "upload" virtual path which was used for page files and global uploads. As part of the upgrade I separated the page files into their own folder with their own virtual path (/pages/). This creates a problem because all the links in content still point at /upload/ for page files. So you need to add:
<map fromPath="/upload" toPath="/pages" type="EPiServer.FileSystem.Mapping.PageDirectoryMapping,EPiServer" />
More info here: http://world.episerver.com/en/Documentation/Items/Tech-Notes/EPiServer-CMS-5/EPiServer-CMS-5-R2/EPiServer-CMS-Migration-Tool-11/#Prerequisites
Then during the upgrade that mapping gets converted to something like this:
<add toPath="~/pages/" fromPath="~/upload/" name="Mapping0" type="EPiServer.Web.Hosting.VirtualPathPageMappingProvider,EPiServer.Legacy4" />
So the VirtualPahPageMappingProvider is mapping requests for the path /upload/ to path /pages/, it should be last in the list of providers in the configuration if you have another provider handling the /upload/ path.