404 re-visited

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/9/2010 9:40:32 AM
Gravatar
Total Posts 13

404 re-visited

can the following code be used from other posts

<customErrors mode="RemoteOnly" defaultRedirect="yourcustomerrorpage.aspx">
<error statusCode="404" redirect="~/PageNotFound.aspx" />
</customErrors>

 

I understand its not a true 404  but at least it will bring up the pagenotfound.aspx  right?

I added it to the user.config file  but I am getting a error (missing child element , expecting  add, remove,,,,,

In the web.config   do i need one of those key statements?

 

3/9/2010 10:02:03 AM
Gravatar
Total Posts 18439

Re: 404 re-visited

You cannot put anything in user.config except things from the appSettings section of Web.config, anything else you must maintain customizations in your Web.config and restore them to the new Web.config when you upgrade.

You could probably put that in your Web.config but I think it is not a good idea and could hurt SEO because with a redirect to an error page the status code served is not 404 but 200 and this means search engines will never see a 404 on your site, every unfound url will look like a duplicate page.

3/9/2010 10:24:55 AM
Gravatar
Total Posts 13

Re: 404 re-visited

Since I own the server, is their anything i can do on IIS to manually fix this?

3/9/2010 10:35:32 AM
Gravatar
Total Posts 18439

Re: 404 re-visited

You could comment out the PageNotFoundHandler from the httpModules section of Web.config and let IIS serve the 404 page, and then do some googling about how to customize the IIS 404 page

Hope it helps,

Joe

3/9/2010 10:39:17 AM
Gravatar
Total Posts 13

Re: 404 re-visited

I will try that.

What do i have to do to comment it out?

3/9/2010 10:55:50 AM
Gravatar
Total Posts 18439

Re: 404 re-visited

Look for this in httpModules section:

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

and comment it out like this:

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

You should make notes about this customization so you remember it when you upgrade later. It is important always to use the newWeb.config and re-apply customizations like this.

3/9/2010 11:08:17 AM
Gravatar
Total Posts 13

Re: 404 re-visited

Thank you, hopefully in the next upgrade this will work.

Thank you again

3/9/2010 12:18:21 PM
Gravatar
Total Posts 13

Re: 404 re-visited

 FYI

I just got off the phone with MSFT seeking help and they told me that the 404 error output page should always end with an html extension. Could this be the problem?

3/9/2010 1:02:35 PM
Gravatar
Total Posts 13

Re: 404 re-visited

changed to

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

and added

<customErrors mode="RemoteOnly" defaultRedirect="Error.htm">
<error statusCode="413" redirect="~/NeatUpload/Error413.aspx" />
<error statusCode="404" redirect="~/PageNotFound.aspx" />
</customErrors>

Now page comes up.   did i break anything or do some thing doing it this way?

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