Problem with the home page / friendly URLs

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.
8/28/2010 11:07:52 AM
Gravatar
Total Posts 4

Problem with the home page / friendly URLs

Hi, I'm having some problems with some pages of my new site (just created it using mojoPortal 2.3.5.1):

E.g. I have named my main page "Home" and the resulting friendly URL is "~/home.aspx". I can access the page using "www.mysite.com/" and "www.mysite.com/default.aspx", but if I use "www.mysite.com/home.aspx" (or if I click the page's tab) I get an error message: "We're sorry but we could not find the page ...". What is strange, is that the URL shown by the browser is now ".../1home.aspx" instead of ".../home.aspx".

I also have another page named contact (friendly URL "~/contact.aspx"). If I click the corresponding tab or enter that URL, I am redirected to a different page (named guestbook, with friendly URL ~/guestbook.aspx).

How can I diagnose and fix these problems?

Thanks a lot for your help!

 

Below is an excerpt from the log (don't know if it helps):

 

2010-08-28 17:48:03,421 ERROR mojoPortal.Web.PageNotFoundHttpModule - XXX.XXX.XXX.XX PageNotFoundHttpModule handled error.
System.Web.HttpException (0x80004005): The file '/1home.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, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
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-08-28 18:00:02,079 ERROR mojoPortal.Web.PageNotFoundHttpModule - XXX.XXX.XXX.XX PageNotFoundHttpModule handled error.
System.Web.HttpException (0x80004005): The file '/1home.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, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
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-08-28 18:01:42,655 INFO mojoPortal.Business.WebHelpers.IndexHelper - IndexHelper.RebuildPageIndex - Contact
2010-08-28 18:01:42,702 INFO mojoPortal.Business.WebHelpers.HtmlContentIndexBuilderProvider - HtmlContentIndexBuilderProvider indexing page - Contact  

8/28/2010 12:56:13 PM
Gravatar
Total Posts 18439

Re: Problem with the home page / friendly URLs

Hi,

When pages are renamed and new urls are created, there is also an automatic 301 redirect created from the old url to the new one. If you try to create a page with the same name "home" and there already exists a page using the friendly url home.aspx it will append a number like 1home.aspx to prevent a duplicate.

Possibly you have some of these friendly urls or 301 redirect with unexpected/unintended settings. I recommend look around under Administration > Advanced Tools > Url Manager and 301 Redirect Manager to look for urls you did not intend. If you delete a friendly url for a page then you need to go back to edit the page to create a new friendly url. If it returns a page not found, then maybe the url was already deleted, then you can get to the edit page from Administration > Add/Edit Pages, select it from the list and click the wrench  to get to settings. Tab out of the page name and it will suggest an url based on the name, then save the page.

Also if you have a custom feature on a page and it fails to find/load your user control, it can also cause the page not found error, but it is really the control that is not found.

Hope it helps,

Joe

8/28/2010 1:08:01 PM
Gravatar
Total Posts 4

Re: Problem with the home page / friendly URLs

Thanks a lot, Joe. It was indeed because of the 301 redirects (I was renaming the pages before).

And thanks for the great software, it really made it easy to setup my site (and I already created my own guestbook module).

- Martin

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