Virtual paths not working

Vote:
 

I've just installed a local copy of EPiServer 6 r2 and the Alloy Tech sample site.  Everything except the virtual paths are working.  The paths are in the EPiServer.config file and seem correct but are clearly not working.  The urls seem to map to the site root regardless.  Anyone know how I can fix it?

#76651
Oct 30, 2013 14:51
Vote:
 

Can you post the part of your config where the VPP paths are defined?

They should look like this: http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-6/EPiServer-CMS-60/Virtual-Path-Providers/

#76670
Edited, Oct 31, 2013 8:14
Vote:
 

Here is the code extract from the episerver.config file.  I have checked and all the locations do exist.  If I access the admin page, the debugging console shows 404 errors for the various scripts.  If I try and access one of the scripts directly through firefox, it shows a full 404 page and shows that it's trying to find the files from the root folder each time.

<virtualPath customFileSummary="~/FileSummary.config">
    <providers>
      <clear />
      <add showInFileManager="true" virtualName="Page Files" virtualPath="~/PageFiles/" bypassAccessCheck="false" name="SitePageFiles" type="EPiServer.Web.Hosting.VirtualPathVersioningProvider,EPiServer" indexingServiceCatalog="Web" physicalPath="C:\EPiServer\VPP\EPiServer6r2Test\PageFiles" />
      <!--<add showInFileManager="false" virtualName="Virtual Path Mappings" virtualPath="~/upload/"
            bypassAccessCheck="false" name="SitePathMappings" type="EPiServer.Web.Hosting.VirtualPathMappedProvider,EPiServer" />-->
      <add showInFileManager="true" virtualName="Global Files" virtualPath="~/Global/" bypassAccessCheck="false" name="SiteGlobalFiles" type="EPiServer.Web.Hosting.VirtualPathVersioningProvider,EPiServer" indexingServiceCatalog="Web" physicalPath="C:\EPiServer\VPP\EPiServer6r2Test\Global" />
      <add showInFileManager="true" virtualName="Documents" virtualPath="~/Documents/" bypassAccessCheck="false" maxVersions="5" name="SiteDocuments" type="EPiServer.Web.Hosting.VirtualPathVersioningProvider,EPiServer" physicalPath="C:\EPiServer\VPP\EPiServer6r2Test\Documents" />
      <!--
        <add showInFileManager="true" virtualName="Global Files" virtualPath="~/Global/"
          bypassAccessCheck="false" indexingServiceCatalog="Web" physicalPath="%EPISERVERFILESDIR%\EPiServerFiles\Globals"
          name="SiteGlobalFiles" type="EPiServer.Web.Hosting.VirtualPathNativeProvider,EPiServer"
          WriteAccess="Administrators" DeleteAccess="Administrators" />
        -->
      <add name="App_Themes_Default" virtualPath="~/App_Themes/Default/" physicalPath="C:\Program Files (x86)\EPiServer\CMS\6.1.379.0\application\App_Themes\Default" type="EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider,EPiServer" />
      <add name="UI" virtualPath="~/Admin/UI/CMS/" physicalPath="C:\Program Files (x86)\EPiServer\CMS\6.1.379.0\application\UI\CMS" type="EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider,EPiServer" />
      <add name="UtilFiles" virtualPath="~/Util/" physicalPath="C:\Program Files (x86)\EPiServer\CMS\6.1.379.0\application\util" type="EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider,EPiServer" />
      <add name="WebServiceFiles" virtualPath="~/WebServices/" physicalPath="C:\Program Files (x86)\EPiServer\CMS\6.1.379.0\application\webservices" type="EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider,EPiServer" />
      <add name="EPiServerCMS" virtualPath="~/Admin/UI/CMS/" physicalPath="C:\Program Files (x86)\EPiServer\CMS\6.1.379.0\application\UI\EPiServer\CMS" type="EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider,EPiServer" />
      <add name="EPiServerShell" virtualPath="~/Admin/UI/Shell/" physicalPath="C:\Program Files (x86)\EPiServer\Framework\6.2.267.1\Application\UI" type="EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider,EPiServer" />
      <add name="EPiServerUrlMappingVPP" virtualName="ExtensionMapping" virtualPath="~/Admin/UI/CMS/" bypassAccessCheck="false" showInFileManager="false" type="EPiServer.Web.Hosting.VirtualPathMappedProvider,EPiServer" />
    </providers>
    <filters />
  </virtualPath>

    The error when trying to access directly is as follows:

Detailed Error Information:

Module    IIS Web Core
Notification    MapRequestHandler
Handler    StaticFile
Error Code    0x80070002
Requested URL    http://localhost:17000/Admin/UI/Shell/ClientResources/ShellWidgets.js
Physical Path    C:\EPiServer\Sites\EPiServer6r2Test\Admin\UI\Shell\ClientResources\ShellWidgets.js
Logon Method    Anonymous
Logon User    Anonymous
#76688
Edited, Oct 31, 2013 10:15
Vote:
 

Your VPPs from episerver.config need a corresponding section in web.config, like this (IIS7 format, see my link above for IIS6 format if needed):

<location path="Documents">
  <staticFile expirationTime="-1.0:0:0"/>
  <system.webServer>
    <handlers>
      <add name="wildcard" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer"/>
    </handlers>
  </system.webServer>
</location> 

    

#76692
Oct 31, 2013 10:38
Vote:
 

These are the ones I have

<location path="PageFiles">
    <system.web>
      <!-- Make sure that the WebResource loader of ASP.NET is initialized correctly -->
      <!-- Setup the StaticFileHandler for the wildcard mapping to work in IIS6 -->
      <httpHandlers>
        <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="true" />
        <add path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" validate="true" />
      </httpHandlers>
    </system.web>
    <staticFile expirationTime="-1.0:0:0" />
  </location>
  <location path="Documents">
    <system.web>
      <!-- Setup the StaticFileHandler for the wildcard mapping to work in IIS6 -->
      <httpHandlers>
        <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="true" />
        <add path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" validate="true" />
      </httpHandlers>
    </system.web>
    <staticFile expirationTime="-1.0:0:0" />
  </location>
  <location path="Global">
    <system.web>
      <!-- Setup the StaticFileHandler for the wildcard mapping to work in IIS6 -->
      <httpHandlers>
        <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="true" />
        <add path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" validate="true" />
      </httpHandlers>
    </system.web>
    <staticFile expirationTime="-1.0:0:0" />
  </location>
  <!-- 
    Uncomment the following section replace UI in the path attribute with your customized UI path 
    to enable Office integration in the application. 
  -->
  <!--<location path="EPiServer/CMS/OfficeIntegration">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>-->
  
  <location path="util">
    <system.web>
      <pages enableEventValidation="true">
        <controls>
          <add tagPrefix="EPiServerUI" namespace="EPiServer.UI.WebControls" assembly="EPiServer.UI" />
          <add tagPrefix="EPiServerScript" namespace="EPiServer.ClientScript.WebControls" assembly="EPiServer" />
        </controls>
      </pages>
      <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
      <httpHandlers>
        <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="true" />
        <add path="*.aspx" verb="*" type="System.Web.UI.PageHandlerFactory" validate="true" />
        <add path="*.ashx" verb="*" type="System.Web.UI.SimpleHandlerFactory" validate="true" />
        <add path="*.asmx" verb="*" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
        <add path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" validate="true" />
      </httpHandlers>
    </system.web>
  </location>

    

#76693
Oct 31, 2013 10:40
Vote:
 

Your config is in IIS6 format. Are you sure you're running IIS6 in your environment?

#76694
Oct 31, 2013 10:43
Vote:
 

Gah!  I'm actually running IIS 8.5 (it's on my local machine)

#76695
Oct 31, 2013 10:50
Vote:
 

Just ran %SystemRoot%\system32\inetsrv\appcmd migrate config "EPiServer6r2Test/"

It says it converted stuff but the code I posted above hasn't changed one bit

#76696
Oct 31, 2013 11:13
Vote:
 

Just try substituting your <system.web> nodes with <system.webServer> (inside the <location> nodes) and see if that solves it

#76697
Oct 31, 2013 11:15
Vote:
 

Didn't work.  Liked the <system.webServer> but then it didn't like <httpHandlers>

#76698
Oct 31, 2013 11:18
Vote:
 

In IIS7+ it's changed to <handlers>. Take a look at my TechNote link above, it's all there :-)

#76700
Edited, Oct 31, 2013 11:23
Vote:
 

Updated the web.config file.  Still not working :(

<location path="PageFiles">
    <system.webServer>
      <!-- Make sure that the WebResource loader of ASP.NET is initialized correctly -->
      <!-- Setup the StaticFileHandler for the wildcard mapping to work in IIS6 -->
      <handlers>
        <add name="webresource" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" />
        <add name="filehandler" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" />
      </handlers>
    </system.webServer>
    <staticFile expirationTime="-1.0:0:0" />
  </location>
  <location path="Documents">
    <system.webServer>
      <!-- Setup the StaticFileHandler for the wildcard mapping to work in IIS6 -->
      <handlers>
        <add name="webresource" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" />
        <add name="filehandler" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" />
      </handlers>
    </system.webServer>
    <staticFile expirationTime="-1.0:0:0" />
  </location>
  <location path="Global">
    <system.webServer>
      <!-- Setup the StaticFileHandler for the wildcard mapping to work in IIS6 -->
      <handlers>
        <add name="webresource" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" />
        <add name="filehandler" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" />
      </handlers>
    </system.webServer>
    <staticFile expirationTime="-1.0:0:0" />
  </location>
  <!-- 
    Uncomment the following section replace UI in the path attribute with your customized UI path 
    to enable Office integration in the application. 
  -->
  <!--<location path="EPiServer/CMS/OfficeIntegration">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>-->
  
  <location path="util">
    <system.webServer>
      <!--<pages enableEventValidation="true">
        <controls>
          <add tagPrefix="EPiServerUI" namespace="EPiServer.UI.WebControls" assembly="EPiServer.UI" />
          <add tagPrefix="EPiServerScript" namespace="EPiServer.ClientScript.WebControls" assembly="EPiServer" />
        </controls>
      </pages>-->
      <!--<globalization requestEncoding="utf-8" responseEncoding="utf-8" />-->
      <handlers>
        <add name="webresource" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" />
        <add name="pagehandler" path="*.aspx" verb="*" type="System.Web.UI.PageHandlerFactory" />
        <add name="simplehandler" path="*.ashx" verb="*" type="System.Web.UI.SimpleHandlerFactory" />
        <add name="servicehandler" path="*.asmx" verb="*" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        <add name="staticfile" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" />
      </handlers>
    </system.webServer>
  </location>

    

#76701
Oct 31, 2013 11:31
Vote:
 

Success!  Here are the working lines:

<location path="PageFiles">
        <staticFile expirationTime="-1.0:0:0" />
        <system.webServer>
            <handlers>
                <clear />
                <add name="webresources" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" />
                <add name="wildcard" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" />
            </handlers>
        </system.webServer>
    </location>
  <location path="Documents">
    <system.webServer>
      <!-- Setup the StaticFileHandler for the wildcard mapping to work in IIS6 -->
      <handlers>
        <clear />
        <add name="webresource" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" />
        <add name="filehandler" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" />
      </handlers>
    </system.webServer>
    <staticFile expirationTime="-1.0:0:0" />
  </location>
  <location path="Global">
      <system.web>
          <httpHandlers>
              <clear />
              <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="true" />
              <add path="*.aspx" verb="*" type="System.Web.UI.PageHandlerFactory" validate="true" />
              <add path="*.ashx" verb="*" type="System.Web.UI.SimpleHandlerFactory" validate="true" />
              <add path="*.asmx" verb="*" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
              <add path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" validate="true" />
          </httpHandlers>
      </system.web>
    <system.webServer>
      <!-- Setup the StaticFileHandler for the wildcard mapping to work in IIS6 -->
      <handlers>
        <clear />
        <add name="webresource" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" />
        <add name="filehandler" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" />
      </handlers>
    </system.webServer>
    <staticFile expirationTime="-1.0:0:0" />
  </location>
  <location path="Admin/UI/CMS">
      <system.web>
          <pages enableEventValidation="true">
              <controls>
                  <add tagPrefix="EPiServerUI" namespace="EPiServer.UI.WebControls" assembly="EPiServer.UI" />
                  <add tagPrefix="EPiServerScript" namespace="EPiServer.ClientScript.WebControls" assembly="EPiServer" />
                  <add tagPrefix="EPiServerScript" namespace="EPiServer.UI.ClientScript.WebControls" assembly="EPiServer.UI" />
              </controls>
          </pages>
          <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
          <httpHandlers>
              <clear />
              <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="true" />
              <add path="*.aspx" verb="*" type="System.Web.UI.PageHandlerFactory" validate="true" />
              <add path="*.ashx" verb="*" type="System.Web.UI.SimpleHandlerFactory" validate="true" />
              <add path="*.asmx" verb="*" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
              <add path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" validate="true" />
          </httpHandlers>
      </system.web>
        <system.webServer>
            <!-- Setup the StaticFileHandler for the wildcard mapping to work in IIS6 -->
            <handlers>
                <clear />
                <add name="webresource" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" />
                <add name="aspxresource" path="*.aspx" verb="*" type="System.Web.UI.PageHandlerFactory" />
                <add name="ashxresource" path="*.ashx" verb="*" type="System.Web.UI.SimpleHandlerFactory" />
                <add name="asmxresource" path="*.asmx" verb="*" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
                <add name="filehandler" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" />
            </handlers>
        </system.webServer>
        <staticFile expirationTime="-1.0:0:0" />
  </location>
    <location path="Admin/UI/Shell">
        <system.web>
            <pages enableEventValidation="true">
                <controls>
                    <add tagPrefix="EPiServerUI" namespace="EPiServer.UI.WebControls" assembly="EPiServer.UI" />
                    <add tagPrefix="EPiServerScript" namespace="EPiServer.ClientScript.WebControls" assembly="EPiServer" />
                    <add tagPrefix="EPiServerScript" namespace="EPiServer.UI.ClientScript.WebControls" assembly="EPiServer.UI" />
                </controls>
            </pages>
            <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
            <httpHandlers>
                <clear />
                <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="true" />
                <add path="*.aspx" verb="*" type="System.Web.UI.PageHandlerFactory" validate="true" />
                <add path="*.ashx" verb="*" type="System.Web.UI.SimpleHandlerFactory" validate="true" />
                <add path="*.asmx" verb="*" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
                <add path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" validate="true" />
            </httpHandlers>
        </system.web>
        <system.webServer>
            <!-- Setup the StaticFileHandler for the wildcard mapping to work in IIS6 -->
            <handlers>
                <clear />
                <add name="webresource" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" />
                <add name="aspxresource" path="*.aspx" verb="*" type="System.Web.UI.PageHandlerFactory" />
                <add name="ashxresource" path="*.ashx" verb="*" type="System.Web.UI.SimpleHandlerFactory" />
                <add name="asmxresource" path="*.asmx" verb="*" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
                <add name="filehandler" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" />
            </handlers>
        </system.webServer>
        <staticFile expirationTime="-1.0:0:0" />
    </location>

    

Fundamentally, the new paths were missing. (Admin/UI/CMS and Admin/UI/Shell) and tada!  Thanks for your help Arild!  There are still minor bugs but with the paths working, it should be a case of working through them

#76703
Edited, Oct 31, 2013 12:24
Vote:
 

Better add that you'll need to add 

controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"

    to the pages section in the main section to ensure that the treeview works properly in the Admin section

#76710
Oct 31, 2013 13:25
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.