Try this web.config for Standard 4.0 website:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="microsoft.web" type="Microsoft.Web.Configuration.MicrosoftWebSectionGroup">
<section name="converters" type="Microsoft.Web.Configuration.ConvertersSection" requirePermission="false" />
<section name="webServices" type="Microsoft.Web.Configuration.WebServicesSection" requirePermission="false" />
<section name="authenticationService" type="Microsoft.Web.Configuration.AuthenticationServiceSection" requirePermission="false" />
<section name="profileService" type="Microsoft.Web.Configuration.ProfileServiceSection" requirePermission="false" />
</sectionGroup>
</configSections>
<microsoft.web>
<converters>
<add type="Microsoft.Web.Script.Serialization.Converters.DataSetConverter" />
<add type="Microsoft.Web.Script.Serialization.Converters.DataRowConverter" />
<add type="Microsoft.Web.Script.Serialization.Converters.DataTableConverter" />
</converters>
<webServices enableBrowserAccess="true" />
</microsoft.web>
<system.web>
<globalization culture="nb-NO" />
<httpRuntime executionTimeout="240" maxRequestLength="1000000" requestValidationMode="2.0" />
<httpHandlers>
<add path="*.asbx" verb="*" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false" />
</httpHandlers>
<httpModules>
<add type="WAF.Presentation.Web.WAFHttpModule, WAF" name="WAFHttpModule" />
</httpModules>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="Microsoft.Build.Utilities, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Workflow.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Messaging, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Workflow.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Transactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Workflow.ComponentModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Drawing.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Runtime.Serialization.Formatters.Soap, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Data.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Data.Services.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</assemblies>
<buildProviders>
<add extension=".asbx" type="Microsoft.Web.Services.BridgeBuildProvider" />
</buildProviders>
</compilation>
<authentication mode="Forms">
<forms loginUrl="WAF/View/Login.aspx" protection="All" timeout="30" />
</authentication>
<membership defaultProvider="WAFMembershipProvider" userIsOnlineTimeWindow="15">
<providers>
<clear />
<add name="WAFMembershipProvider" type="WAF.Presentation.Web.WAFMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" applicationName="AppName" requiresUniqueEmail="false" passwordFormat="Clear" />
</providers>
</membership>
<roleManager enabled="true" cacheRolesInCookie="true" defaultProvider="WAFRoleProvider" cookieName=".ASPXROLES" cookiePath="/" cookieTimeout="30" cookieRequireSSL="false" cookieSlidingExpiration="true" createPersistentCookie="false" cookieProtection="All">
<providers>
<clear />
<add name="WAFRoleProvider" type="WAF.Presentation.Web.WAFRoleProvider" connectionStringName="" applicationName="WAFApp" />
</providers>
</roleManager>
<pages validateRequest="true" enableViewStateMac="false" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
<controls>
<add assembly="WAF" namespace="WAF.Presentation.Web" tagPrefix="waf" />
</controls>
</pages>
<sessionState timeout="30" />
<identity impersonate="false" />
<!-- <customErrors mode="Off" />-->
</system.web>
<appSettings>
<add key="WAF.DbProvider" value="[%WAF_DB_PROVIDER%]" />
<add key="WAF.DbConnectionString" value="[%WAF_CONNECTION_STRING%]" />
<add key="WAF.MasterUsername" value="[%WAF_MASTERUSERNAME%]" />
<add key="WAF.MasterPassword" value="[%WAF_MASTERPASSWORD%]" />
</appSettings>
<system.webServer>
<directoryBrowse enabled="true" />
<modules>
<add name="WAFHttpModule" type="WAF.Presentation.Web.WAFHttpModule, WAF" preCondition="managedHandler" />
</modules>
<handlers>
<add name="Wildcard 64" path="*" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv2.0,bitness64" />
<add name="Wildcard 32" path="*" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
<add name="*.asbx_*" path="*.asbx" verb="*" type="Microsoft.Web.Services.ScriptHandlerFactory" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="*.asmx_*" path="*.asmx" verb="*" type="Microsoft.Web.Services.ScriptHandlerFactory" preCondition="integratedMode,runtimeVersionv2.0" />
</handlers>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
</configuration>
Try this web.config for Standard MVC 4.0 website:
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="WAF.DbProvider" value="[%WAF_DB_PROVIDER%]" />
<add key="WAF.DbConnectionString" value="[%WAF_CONNECTION_STRING%]" />
<add key="WAF.MasterUsername" value="[%WAF_MASTERUSERNAME%]" />
<add key="WAF.MasterPassword" value="[%WAF_MASTERPASSWORD%]" />
</appSettings>
<system.web>
<httpRuntime executionTimeout="240" maxRequestLength="1000000" requestValidationMode="2.0" />
<httpModules>
<add type="WAF.Presentation.Web.WAFHttpModule, WAF" name="WAFHttpModule" />
</httpModules>
<compilation debug="true" numRecompilesBeforeAppRestart="100" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Data.Services.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Workflow.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Workflow.ComponentModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Workflow.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
<authentication mode="Forms">
<forms loginUrl="WAF/View/Login.aspx" protection="All" timeout="30" />
</authentication>
<membership defaultProvider="WAFMembershipProvider" userIsOnlineTimeWindow="15">
<providers>
<clear />
<add name="WAFMembershipProvider" type="WAF.Presentation.Web.WAFMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" applicationName="AppName" requiresUniqueEmail="false" passwordFormat="Clear" />
</providers>
</membership>
<roleManager enabled="true" cacheRolesInCookie="true" defaultProvider="WAFRoleProvider" cookieName=".ASPXROLES" cookiePath="/" cookieTimeout="30" cookieRequireSSL="false" cookieSlidingExpiration="true" createPersistentCookie="false" cookieProtection="All">
<providers>
<clear />
<add name="WAFRoleProvider" type="WAF.Presentation.Web.WAFRoleProvider" connectionStringName="" applicationName="WAFApp" />
</providers>
</roleManager>
<pages>
<controls>
<add assembly="WAF" namespace="WAF.Presentation.Web" tagPrefix="waf" />
</controls>
<namespaces>
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages"/>
</namespaces>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<add type="WAF.Presentation.Web.WAFHttpModule, WAF" name="WAFHttpModule" />
</modules>
</system.webServer>
</configuration>