Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > 404 Not Working View modes: 
User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 6/27/2013 7:22:53 AM
   
404 Not Working
I've attempted every trick in the book to get my 404 page to work in the content tree with no success. I've followed the documentation to a tee and still see the same results, no 404 page being displayed from the content tree or even the file system.

I'm running Windows Server 2008 R2 IIS 7.5 integrated pipeline at the root of an IIS website, Kentico 7.0.40 with extensionless URL's. Any suggestions are appreciated, I'm at a loss.

User avatar
Member
Member
matt-awg - 6/27/2013 8:31:36 AM
   
RE:404 Not Working
no 404 page being displayed from the content tree or even the file system.

What do you get when you visit a page that is not found? You don't see the default IIS message or the Kentico 404 page then what do you see? A blank page?

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 6/27/2013 8:50:24 AM
   
RE:404 Not Working
Sorry Matt, I was a bit vague there. Here is what I get:

User image

At one time I modified the web.config (as suggested in above documentation) and added my info in this section and saw an IIS message stating directory not found
<system.webServer> 
...
<httpErrors existingResponse="Auto" errorMode="Custom">
<clear />
<error statusCode="500" path="/CMSMessages/CustomError.aspx" responseMode="ExecuteURL" />
</httpErrors>
...
</system.webServer>

Here is what my error nodes look like currently:
<location path="." inheritInChildApplications="false">
<system.web>
...
<customErrors defaultRedirect="~/CMSMessages/error.aspx" mode="Off">
<error statusCode="404" redirect="~/CMSMessages/PageNotFound.aspx"/>
</customErrors>
....
</system.web>
</location>
...
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<!-- Extensionless URLs BEGIN -->
<httpErrors existingResponse="PassThrough"/>
<modules runAllManagedModulesForAllRequests="true">
<!-- Extensionless URLs END -->
<remove name="WebDAVModule"/>
<remove name="XHtmlModule"/>
<remove name="CMSApplicationModule"/>
<remove name="UrlRoutingModule"/>
<remove name="Detector"/>
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule,System.Web.Routing, Version=3.5.0.0,Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="XHtmlModule" type="CMS.CMSOutputFilter.OutputFilterModule, CMS.OutputFilter"/>
<add name="CMSApplicationModule" preCondition="managedHandler" type="CMS.CMSHelper.CMSApplicationModule, CMS.CMSHelper"/>
<add name="Detector" type="FiftyOne.Foundation.Mobile.Detection.DetectorModule, FiftyOne.Foundation"/>
<add name="ErrorHandlerModule" preCondition="managedHandler" type="System.Web.Mobile.ErrorHandlerModule, System.Web.Mobile, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</modules>
<handlers>
<remove name="MetaWeblogAPI"/>
<remove name="UrlRoutingHandler"/>
<add name="MetaWeblogAPI" preCondition="integratedMode" verb="*" path="MetaWeblog.ashx" type="CMS.MetaWeblogProvider.MetaWeblogAPI, CMS.MetaWeblogProvider"/>
<add name="ChartImageHandler" preCondition="integratedMode" verb="*" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</handlers>
</system.webServer>

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 7/1/2013 3:30:15 AM
   
RE:404 Not Working
Hi,

I have followed the documentation and the only changes I made was:
1. create the 404 page in the content tree
2. set this page in the Settings section
3. added the runAllManagedModulesForAllRequests parameter to the web.config file

and it is working just fine. What .Net version are you using and how are the handler mappings set in the IIS?

Here is my web.config file:
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<configSections>
<!-- Content staging BEGIN -->
<section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<!-- Content staging END -->
<!-- FiftyOne BEGIN -->
<sectionGroup name="fiftyOne">
<section name="log" type="FiftyOne.Foundation.Mobile.Configuration.LogSection, FiftyOne.Foundation" requirePermission="false" allowDefinition="Everywhere" restartOnExternalChanges="false" allowExeDefinition="MachineToApplication" />
<section name="redirect" type="FiftyOne.Foundation.Mobile.Configuration.RedirectSection, FiftyOne.Foundation" requirePermission="false" allowDefinition="Everywhere" restartOnExternalChanges="false" allowExeDefinition="MachineToApplication" />
<section name="detection" type="FiftyOne.Foundation.Mobile.Detection.Configuration.DetectionSection, FiftyOne.Foundation" requirePermission="false" allowDefinition="Everywhere" restartOnExternalChanges="false" allowExeDefinition="MachineToApplication" />
</sectionGroup>
<!-- FiftyOne END -->
</configSections>
<appSettings>
<add key="WS.webservice" value="http://localhost/WebService/webservice.asmx" />

<add key="CMSApplicationName" value="test" />

</appSettings>
<connectionStrings>
<clear />

</connectionStrings>
<system.web>
<pages validateRequest="false" clientIDMode="AutoID">
<controls>
<add tagPrefix="ajaxToolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" />
<add tagPrefix="cms" namespace="CMS.PortalControls" assembly="CMS.PortalControls" />
<add tagPrefix="cms" namespace="CMS.Controls" assembly="CMS.Controls" />
<add tagPrefix="cms" namespace="CMS.FormEngine" assembly="CMS.FormEngine" />
<add tagPrefix="cms" namespace="CMS.FormControls" assembly="CMS.FormControls" />
<add tagPrefix="cms" namespace="CMS.ExtendedControls" assembly="CMS.ExtendedControls" />
<add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization" />
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions" />
</controls>
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="CMS.CMSHelper" />
<add namespace="CMS.GlobalHelper" />
</namespaces>
</pages>
<customErrors defaultRedirect="~/CMSMessages/error.aspx" mode="Off">
<error statusCode="404" redirect="~/CMSMessages/PageNotFound.aspx" />
</customErrors>
<authentication mode="Forms">
<forms loginUrl="CMSPages/logon.aspx" defaultUrl="Default.aspx" name=".ASPXFORMSAUTH" timeout="60000" slidingExpiration="true" />
</authentication>
<httpRuntime maxRequestLength="2097151" waitChangeNotification="1" maxWaitChangeNotification="3600" requestValidationMode="2.0" maxUrlLength="1000" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US" uiCulture="en-US" />
<membership defaultProvider="CMSProvider" userIsOnlineTimeWindow="30">
<providers>
<clear />
<add name="CMSProvider" type="CMS.MembershipProvider.CMSMembershipProvider" connectionStringName="CMSConnectionString" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" passwordFormat="Hashed" />
</providers>
</membership>
<roleManager defaultProvider="CMSRoleProvider" enabled="true" cacheRolesInCookie="true" cookieName=".ASPROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All">
<providers>
<clear />
<add name="CMSRoleProvider" type="CMS.MembershipProvider.CMSRoleProvider" connectionStringName="CMSConnectionString" applicationName="SampleApplication" writeExceptionsToEventLog="false" />
</providers>
</roleManager>
<httpHandlers>
<add path="ChartImg.axd" verb="*" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
</httpHandlers>
<httpModules>
<add name="XHtmlModule" type="CMS.CMSOutputFilter.OutputFilterModule, CMS.OutputFilter" />
<add name="CMSApplicationModule" type="CMS.CMSHelper.CMSApplicationModule, CMS.CMSHelper" />
</httpModules>
<xhtmlConformance mode="Strict" />
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20" />
<compilation debug="true" numRecompilesBeforeAppRestart="100" targetFramework="4.0">
<assemblies>
<add assembly="SMDiagnostics, Version=3.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="Microsoft.Transactions.Bridge, Version=3.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Management, 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.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Configuration.Install, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Deployment, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Transactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Web.RegularExpressions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Messaging, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.IdentityModel.Selectors, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.ServiceProcess, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral,PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
<!-- Different programming languages BEGIN -->

<!-- <codeSubDirectories>
<add directoryName="CSCode"></add>
<add directoryName="VBCode"></add>
</codeSubDirectories>-->

<!-- Different programming languages END -->
</compilation>
<httpCookies httpOnlyCookies="true" />
</system.web>
<!-- Windows authentication BEGIN -->
<!--
<location path="News">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>-->

<!-- Windows authentication END -->
<location path="cms">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
<!-- WebDAV location BEGIN -->
<location path="cms/files">
<system.web>
<httpHandlers>
<clear />
<add verb="*" path="*" type="CMS.WebDAV.WebDAVHandler, CMS.WebDAV" />
</httpHandlers>
<httpRuntime executionTimeout="2400" maxRequestLength="2097151" />
</system.web>
<system.webServer>
<handlers>
<clear />
<add name="CMSWebDAVHandler" path="*" verb="*" type="CMS.WebDAV.WebDAVHandler, CMS.WebDAV" />
<remove name="xoml-Integrated" />
<add name="*.vbhtml_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.vbhtml" type="System.Web.HttpForbiddenHandler" />
<add name="*.vbhtm_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.vbhtm" type="System.Web.HttpForbiddenHandler" />
<add name="*.cshtml_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.cshtml" type="System.Web.HttpForbiddenHandler" />
<add name="*.cshtm_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.cshtm" type="System.Web.HttpForbiddenHandler" />
<add name="*.xamlx_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.xamlx" type="System.Xaml.Hosting.XamlHttpHandlerFactory, System.Xaml.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="*.xoml_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.xoml" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="*.svc_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.svc" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="*.soap_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.soap" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="*.rem_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.rem" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="*.asmx_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.asmx" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="ScriptResource.axd" preCondition="integratedMode,runtimeVersionv2.0" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="*_AppService.axd_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*_AppService.axd" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="eurl.axd_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="eurl.axd" type="System.Web.HttpNotFoundHandler" />
</handlers>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483648" />
</requestFiltering>
</security>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
</location>
<!-- WebDAV location END -->
<!-- Content staging BEGIN -->
<microsoft.web.services3>
<security>
<securityTokenManager>
<add type="CMS.Synchronization.WebServiceAuthorization" namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" localName="UsernameToken" />
</securityTokenManager>
<x509 allowTestRoot="true" verifyTrust="true" />
</security>
<policy fileName="wse3policy.config" />
<diagnostics>
<trace enabled="false" input="InputTrace.webinfo" output="OutputTrace.webinfo" />
</diagnostics>
</microsoft.web.services3>
<!-- Content staging END -->
<!-- FiftyOne BEGIN -->
<fiftyOne>
<log logFile="~/App_Data/CMSModules/DeviceProfile/logFiftyOne.txt" logLevel="Info" />
<detection binaryFilePath="~/App_Data/CMSModules/DeviceProfile/51Degrees.mobi.dat" />
</fiftyOne>
<!-- FiftyOne END -->
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule" />
<remove name="XHtmlModule" />
<remove name="CMSApplicationModule" />
<remove name="UrlRoutingModule" />
<remove name="Detector" />
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule,System.Web.Routing, Version=3.5.0.0,Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="XHtmlModule" type="CMS.CMSOutputFilter.OutputFilterModule, CMS.OutputFilter" />
<add name="CMSApplicationModule" preCondition="managedHandler" type="CMS.CMSHelper.CMSApplicationModule, CMS.CMSHelper" />
<add name="Detector" type="FiftyOne.Foundation.Mobile.Detection.DetectorModule, FiftyOne.Foundation" />
<add name="ErrorHandlerModule" preCondition="managedHandler" type="System.Web.Mobile.ErrorHandlerModule, System.Web.Mobile, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</modules>
<handlers>
<remove name="MetaWeblogAPI" />
<remove name="UrlRoutingHandler" />
<add name="MetaWeblogAPI" preCondition="integratedMode" verb="*" path="MetaWeblog.ashx" type="CMS.MetaWeblogProvider.MetaWeblogAPI, CMS.MetaWeblogProvider" />
<add name="ChartImageHandler" preCondition="integratedMode" verb="*" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>

<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<bindings>
<basicHttpBinding>
<!-- SalesForce BEGIN -->
<binding name="SalesForceBinding" transferMode="Buffered">
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
<!-- SalesForce END -->
</basicHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="ChatServiceBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="CMS.Chat.ChatService">
<endpoint address="" behaviorConfiguration="ChatServiceBehavior" binding="webHttpBinding" contract="CMS.Chat.IChatService" />
</service>
<service name="CMS.Chat.ChatSupportService">
<endpoint address="" behaviorConfiguration="ChatServiceBehavior" binding="webHttpBinding" contract="CMS.Chat.IChatSupportService" />
</service>
</services>
<client>
<!-- SalesForce BEGIN -->
<endpoint address="https://login.salesforce.com/services/Soap/u/23.0" binding="basicHttpBinding" bindingConfiguration="SalesForceBinding" contract="WebServiceClient.Soap" name="SalesForceClient" />
<!-- SalesForce END -->
</client>
</system.serviceModel>
</configuration>


Notice the different order (the order may be significant) of items after the <modules runAllManagedModulesForAllRequests="true"> tag.

Best regards,
Juraj Ondrus

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 7/1/2013 7:26:55 AM
   
RE:404 Not Working
I moved this
<validation validateIntegratedModeConfiguration="false" />
to look like yours and still the same results. Also checked the Handler Mappings for the site in IIS and not sure what I'm looking for. It appears all the asp.net items are enabled(.aspx, .ascx, .asmx, etc). Running with IIS .NET 4.0 installed with .NET 4.0 using Visual Studio 2012.

User avatar
Member
Member
dford-catapultrpm - 7/1/2013 8:12:27 AM
   
RE:404 Not Working
I found another way to do it in the CMSSiteManager. Go into the CMSSiteManager --> Settings --> Content and select the site you are working with from the drop down box above the nav on the left. In the main section, you should see a page not found section where you can specify the URL of the page you want to be displayed.

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 7/1/2013 8:17:10 AM
   
RE:404 Not Working
Thank you. I've had both the global and site specific settings set to the same value throughout the development process of this project and none of them have worked.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 7/2/2013 1:28:23 AM
   
RE:404 Not Working
Hi,

Would it be possible to raise a support issue - I mean sending us an e-mail to our support referring to this forum thread, with your web.config file as it is right now + access credentials (or, site export package)?

Thank you.

This is really strange.

P.S.: I will update this thread with the solution for sure.

Best regards,
Juraj Ondrus

User avatar
Member
Member
kentico_sandroj - 7/2/2013 11:05:25 AM
   
RE:404 Not Working
Hello,

In this case, the solution is to use the following format in Site Manager > Settings > Content > Page not found:

~\Folder\Page.aspx

Then make sure both the global and site-level settings are configured correctly.

Regards,
Sandro