Products » Support Forums 

Support Forums

HomeHomeDotNetNuke Modu...DotNetNuke Modu...Friendly Url Pr...Friendly Url Pr...Exception when requesting URL with parent page mis-spelledException when requesting URL with parent page mis-spelled
Previous
 
Next
New Post
1/22/2010 12:36 AM
 

I am running FUP 5.1.0 on DNN 4.9.5. If I request a URL in which the parent page of the requested page is mis-spelled I get an ASP.NET exception. Here's an example:

Requested: /COMMOONITY-BLOG/Blog.aspx
Real URL: /COMMUNITY-BLOG/Blog.aspx

However if the requested page name is mis-spelled, this is handled gracefully with the parent page being opened, e.g.

Requested: /COMMUNITY-BLOG/Blg.aspx
Real: /COMMUNITY-BLOG/Blog.aspx

I notice the error is not being thrown by the provider itself. I am hoping you can still "fix" it because it's a big problem when a parent page is renamed and all the links to the child pages in Google etc stop working!

Here's the full error:

System.Exception: Unhandled Error: ---> System.Web.HttpException: The file '/COMMUNITY/Ski-Reports.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) --- End of inner exception stack trace ---

Many thanks

 
New Post
1/22/2010 12:57 AM
 

Where are you seeing this exception?  Is this coming up in the browser, or is the exception from an error log somewhere?

Basically, a mispelt page name results in a 404 error (what you're seeing is the ASP.NET 404 exception).  This is by design.

When you see a child misspelled, the 'parent' page just loads, because it interprets the child page as a parameter in a querystring (the module cannot tell the difference between a mispelled child page and the querystring path for a third party module, like this forum).  If anything, this is a slight design flaw which others have already highlighted to me and I'm looking at solutions.

So, the real issue here is handling the 404 exception better.  To do that, you need to setup 404 handling in your web.config file.

 
New Post
1/23/2010 6:27 PM
 

All the above details came from the DNN event log. What you get on the screen is (as you said) an ASP.NET 404 exception.

I would like to handle the 404 by redirecting to the home page, but the trouble is I already have added  defaultRedirect="/Install/UnderConstruction.htm" to the customErrors element in web.config (to catch "real" ASP.NET exceptions like the DB connection is down). Is there a way to handle the 404 separately from other exceptions?

 
New Post
1/24/2010 5:45 AM
 

The install/underconstruction is the DNN install specific handler.  If you would like to handle the 404 errors differently, then you can setup a different handler other than the 'install/underconstruction.htm' page.  It's really up to you how you would like to handle the errors, because it depends on how many portals there are (the same 404 handler works on all portals) and whether you want to get the users back onto the site, or just show a 'page not found' error.

 
New Post
1/26/2010 12:19 PM
 

OK thanks, I'll check out using a different handler.

However I would like to bug you a bit more about whether this problem can be handled more gracefully by the FUP :)

It's a fairly common, or at least predictable, scenario (that a page gets renamed), and the 404 arises when using the FUP but not when using native DNN URLs (because the tabid param remains constant). So, to someone switching from native DNN urls, it occurs as a slight downside to the FUP (although the positive aspects are so great I would never switch back). I do realise that in a non-DNN/non-dynamic website, changing a part of a page's URL would inevitably lead to a 404 and that is just a fact of life.

So, would you consider adding a parameter to the config that controls where the user is redirected to when the requested URL cannot be matched against any DNN tab? Something like a "404Redirect" parameter?

Thanks

 
Previous
 
Next
HomeHomeDotNetNuke Modu...DotNetNuke Modu...Friendly Url Pr...Friendly Url Pr...Exception when requesting URL with parent page mis-spelledException when requesting URL with parent page mis-spelled


Support Guidelines.. Please read before posting

To get support on iFinity products and services, please search the forums for the the answer to the problem you are seeking. If you cannot find a solution, post a question in the relevant forum.   Ensure that you specify the relevant versions of the problem, and the actual error message or a detailed description of the problem.    You will need to register with this site to post on the forum.  If you have a Microsoft Live (Hotmail/Passport) account you can use that.  If you have a Open Id account you can use that.  If you neither of these, you will need to register a user Id and password.