SaaS CMS has officially launched! Learn more now.

I do not quite get the VirtualPathMappedProvider


I do not quite get the VirtualPathMappedProvider.


Here's one example of how to use it that I've found:



<add showInFileManager="false"





type="EPiServer.Web.Hosting.VirtualPathMappedProvider,EPiServer" />




<add url="~/your/relative/path/to/ui/admin/AdminGroup.aspx"

mappedUrl="~/customadmin/AdminGroup.aspx" />




But when I try it out myself the only thing necessary to get it to work seems to be:



<add name="CustomEditUrlMapping"

type="EPiServer.Web.Hosting.VirtualPathMappedProvider,EPiServer" />



Then I can add:


<add url="~/epi/edit/workspace.aspx"

mappedUrl="~/CommonCode/Plugin/CustomWorkspace.aspx" />

<add url="~/epi/edit/XFormEdit.aspx"

mappedUrl="~/epiCustom/edit/XFormEdit.aspx" />


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


Jul 28, 2010 10:41

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...

Jul 28, 2010 11:06

Just as I thought, thanks Jørgen. 

Jul 30, 2010 10:08

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:

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.

Edited, Sep 08, 2010 22:57
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.