Page Not Found Handler

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
11/3/2009 11:24:32 AM
Gravatar
Total Posts 2187

Page Not Found Handler

How do I make the 404 handler work when using IIS7 and Integrated Pipeline App Pools? The PageNotFoundHandler seems to work fine as long as I use Classic App Pools.

 

11/3/2009 11:34:28 AM
Gravatar
Total Posts 18439

Re: Page Not Found Handler

It works for me on my development machine I'm always using Integrated mode. As long as you have this in the <modules> section of Web.config it should work:

<add name="PageNotFoundHandler" type="mojoPortal.Web.PageNotFoundHttpModule, mojoPortal.Web" />

you might try changing it like this:

<add name="PageNotFoundHandler" type="mojoPortal.Web.PageNotFoundHttpModule, mojoPortal.Web" preCondition="managedHandler" />

and see if it makes a difference or also it could be an issue using extensionless urls vs using .aspx as I'm not using extensionless urls on my machine.

Hope it helps,

Joe

11/3/2009 11:51:37 AM
Gravatar
Total Posts 2187

Re: Page Not Found Handler

Hmm... I added the preCondition but it had no effect. I do get the following error in the app log:

2009-11-03 11:59:00,760 ERROR mojoPortal.Web.PageNotFoundHttpModule - 64.57.210.112  PageNotFoundHttpModule handled error.
System.Web.HttpException: The file '/thispageainthere.aspx' does not exist.
   at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
   at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
   at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
   at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
   at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Thoughts?

-Joe

11/3/2009 11:56:16 AM
Gravatar
Total Posts 18439

Re: Page Not Found Handler

According to that message the PageNotFoundHandler handled it which means it should have shown the custom 404. What are you seeing in the browser? Maybe it can't find the custom404 page. Are you using the one included with mojoPortal or a different one?

11/3/2009 12:17:46 PM
Gravatar
Total Posts 2187

Re: Page Not Found Handler

I am seeing the standard IIS7 404 page (http://acckc.org/thispageainthere.aspx).

AFAIK I am using the custom404 page included with mojoPortal. I haven't adjusted anything to make it use something else.

-Joe

11/3/2009 1:25:04 PM
Gravatar
Total Posts 18439

Re: Page Not Found Handler

Are you running any additional IIS modules like url re-writers or anything that might be affecting it? Like , if you look at the modules list in IIS if there is a module listed higher in the list than the PageNotFoundHandler that may be doing something ith 404s before PageNotFoundHandler can respond.

Try also:

<add name="PageNotFoundHandler" type="mojoPortal.Web.PageNotFoundHttpModule, mojoPortal.Web" preCondition="" />

Also if you have this:

<modules runAllManagedModulesForAllRequests="true">

try changing to this:

<modules>

which will mean extensionless urls won't work but worth ruling out as a factor.

Hope it helps,

Joe

11/3/2009 1:45:32 PM
Gravatar
Total Posts 18439

Re: Page Not Found Handler

Just in case, the setting that would be used to use a custom page for the 404 is:

<add key="Custom404Page" value="/PageNotFound.aspx" />

so if you were overriding that in user.config it could be a factor.

11/3/2009 2:16:58 PM
Gravatar
Total Posts 2187

Re: Page Not Found Handler

I think I am going to try setting up a new site on a clean install of 2008 with IIS 7. I am having this issue on two different servers with any site using Integrated Pipeline. I was using the URL Rewrite tool from MS but I disabled it on one site and I still have the same issue. I have also tried moving the PageNotFoundHandler module to different locations in the <modules> section but to no avail.

I have been testing this on different sites on different servers. I am not sure if my control panel (DotNetPanel) has set something up in IIS that is messing with this or not. That is why I want to try using a clean install.

Thanks for your help. I will let you know what happens with the different server.

Thanks,
Joe D.

1/20/2010 5:21:46 PM
Gravatar
Total Posts 2187

Re: Page Not Found Handler

Hi Joe,

I have tried to resolve this issue in the past but I never found a solution and figured I was just doing something wrong. Honestly, I kind of forgot about it until today when I accidentally mis-typed a page on mojoportal.com. I noticed that the Page Not Found Handler isn't working properly on this site so I figured I would revisit this issue.

I have a mojo site setup on a clean 2008 server and the Page Not Found Handler doesn't work properly if I use a Integrated Pipeline application pool.

Any thoughts?
Joe D.

1/20/2010 5:47:11 PM
Gravatar
Total Posts 2187

Re: Page Not Found Handler

Hey Joe,

I have two different results in the log for the PageNotFoundHandler depending on whether I use Integrated vs Classic app pools.

When using Integrated App Pool I get:

2010-01-20 17:32:49,257 ERROR mojoPortal.Web.PageNotFoundHttpModule - 10.117.198.60 PageNotFoundHttpModule handled error.
System.Web.HttpException: The file '/whois.aspx' does not exist.
at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)

at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
  at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

 

 

When using Classic App Pools I get:

2010-01-20 17:34:27,725 ERROR mojoPortal.Web.PageNotFoundHttpModule - 10.117.198.60 PageNotFoundHttpModule handled error.
System.Web.HttpException: The file '/whois.aspx' does not exist.
at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
  at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

 

You'll notice that everything is the same until the bolded line above. Does that shed any light on the issue?

Thanks,
Joe D.

1/21/2010 5:46:45 PM
Gravatar
Total Posts 1200
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Page Not Found Handler

Hey guys, pardon me for butting in here. I'm pretty new to Mojo, and I was just exploring the friendly 404 feature to see how it works and how I can customize it. What I'm finding is that the handler's not working on my dev site. It also doesn't seem to be working on www.mojoportal.com and demo.mojoportal.com. On all three, when I hit an invalid URL I get the generic "Server Error, 404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable." On my site, the System Log shows this error (seems identical to Joe D's):
 

2010-01-21 15:37:38,942 ERROR mojoPortal.Web.PageNotFoundHttpModule - 10.1.102.199 PageNotFoundHttpModule handled error.
System.Web.HttpException: The file '/bzzzzzt.aspx' does not exist.
at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path)
at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
 

I'm running IIS 7 under Windows Server 2008 standard.


Thanks,

Jamie

You must sign in to post in the forums. This thread is closed to new posts.