404 page handler not working

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
3/7/2010 9:51:48 PM
Gravatar
Total Posts 13

404 page handler not working

I am using the latest version, fresh install on windows 2003 server. pagenotfound.aspx  comes up with no problem, but pages not found are not being redirected or handled by the script. Is there a missing step or check boc i have to activate?  here is the error log.

2010-03-07 19:48:07,515 ERROR mojoPortal.Web.PageNotFoundHttpModule - 173.54.32.38 PageNotFoundHttpModule handled error.
System.Web.HttpException: The file '/test404.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.System.Web.IHttpHandlerFactory2.GetHandler(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)
2010-03-07 19:48:08,031 ERROR mojoPortal.Web.Framework.WebUtils - WebUtils.GetHtmlFromWeb error scraping html from web.
System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.GetResponse()
at mojoPortal.Web.Framework.WebUtils.GetHtmlFromWeb(String url)

3/8/2010 11:57:20 AM
Gravatar
Total Posts 18439

Re: 404 page handler not working

Hi,

The error says PageNotFoundHttpModule handled the error, so the handler was invoked, it will always log these even if it works correctly.

I recently learned of a case where IIS 7 was serving the default 404 even though the handler was handling it, as discussed in this thread, however I've not heard of this happening on IIS 6/Win 2003 but I suppose it still could be some configuration issue.

Hope it helps,

Joe

3/8/2010 12:17:23 PM
Gravatar
Total Posts 13

Re: 404 page handler not working

When I type in wrong urls  it is not bringing up the pagenotfound.apsx file.

Are their any steps that need to be done?

I used the webinstaller and then I upgraded to version 9 using the download zip file

3/8/2010 12:41:00 PM
Gravatar
Total Posts 18439

Re: 404 page handler not working

As far as I know it should just work on Win 2003/IIS 6, it always did for me, I only recently moved this site to Win 2008/IIS 7 and had issues as mentioned in the thread I linked previously. I have not had any other reports of this problem on win 2003/IIS 6. Unfortunately I don't have a win 2003 machine to test on currently.

My best guess would be that you have some kind of 3rd party ISAPI filter installed or something in IIS that is overriding the module. The module itself is working as it shows in the log it is handling the page not found errors, but IIS or some component is redirecting to a different 404 page anyway. So the symptom you describe is the same as the IIS 7 issue but it must have a different cause and solution.

Hope it helps,

Joe

3/8/2010 12:47:14 PM
Gravatar
Total Posts 13

Re: 404 page handler not working

The box has a clean install install of windows 2003, the only addon is the web installer from ASP.net and sql2008 from same.

The only application installed is mojoportal.

One site set for multi site in web config.

if you send the before and after   of where to add that line of code i will do it.

I read the article on previous persons blog and that is way over my head. With version ....9 are there missing steps that have to be done to get the pagenotfound.aspx to come up. It comes up if i type it in...so it is there.

3/8/2010 1:01:12 PM
Gravatar
Total Posts 18439

Re: 404 page handler not working

The code for the IIS 7 problem was already added and exists in mojoportal 2.3.3.9. As mentioned in the other thread this issue was affecting this site (www.mojoportal.com) after I moved to IIS 7/Win 2008, I added the line of code and it solved the problem.

Prior to that I was running Win 2003 and never had the problem, it just worked.

I would make sure you have SP1 for .NET 3.5 installed.

Hope it helps,

Joe

3/8/2010 1:22:23 PM
Gravatar
Total Posts 13

Re: 404 page handler not working

Is the line already in the config file? if not if you could just paste to see how i should copy it I will.

To show my stupidity.

"which involves 1 line of code added to our PageNotFoundHttpModule:

app.Context.Response.TrySkipIisCustomErrors = true;

Where does this go?

3/8/2010 1:31:35 PM
Gravatar
Total Posts 18439

Re: 404 page handler not working

As I said before that line of code was already added, it exists in our source code at Web/Components/PageNotFoundHttpModule.cs

Are you using our source code on your production site?

Are you building your own deployment package from source code?

I recommend you use our mojoportal-2-3-3-9-mssql-deploymentfiles.zip package which is pre-compiled and has no C# source code and is meant for production deployment. All the code is compiled into dlls in the /bin folder

I do not know about the web.config setting mentioned on the other thread, you might try it but I know nothing about it and was under the impression it was related to IIS 7.

Wish I could be more help but I've told you all I know.

Is your site at a public url where I could see the 404 behavior?

3/8/2010 1:38:24 PM
Gravatar
Total Posts 13

Re: 404 page handler not working

That is what i am using, I am not smart enough to be making changes

3/8/2010 1:41:45 PM
Gravatar
Total Posts 13

Re: 404 page handler not working

www. pink fashionista dot com

3/8/2010 1:46:33 PM
Gravatar
Total Posts 18439

Re: 404 page handler not working

Well you asked about the code so I wondered if you were using the code. What you may not understand is that all the code is compiled ahead of time, it is not the same as a scripting language where the code just exists in text files and is interpreted at runtime, like in PHP or Classic ASP where you can just edit a file to make changes if you knew how you, but in this case there is no way to make changes in the deployment package even if you did know how to change the code, there is no C# code in the deployment packages, only dlls. So to make a code change would require working with the source code in Visual Studio then re-compiling after making changes then packaging and deploying the build without the source code.

But, I digress, I do not know why it is not working for you and would be interested to hear if anyone else is having this issue on Win 2003. I ran mojoportal.com for about 2 years until recently on win2003 and the page not found module worked fine for me and no-one else ever reported issues with it so I have no idea why it is not working for you.

Best,

Joe

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