Extentionless url in multi folder based site

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.
5/7/2012 5:59:14 PM
Gravatar
Total Posts 27
https://ict.ken.be
Hybrid coding since
the dawn of time.

Extentionless url in multi folder based site

Hi again, digging into mojo a bit deeper...

Possible issue : xyz.com/nl/extentionlessnonexistingpage will not work -> cuts away url beginning until out of range.

Possible reason :

In mojoPortal.Web.UrlRewriter at line 237 checks if friendly is not found, to be able to continue the request in case of eg. ProfileView.aspx 

However, in case of extentionless url it will cut off beginning and keep rewriting the path until out of range or null.

Underneath there is code to check for file not found, and I guess this code in the else branch should be moved above the if, but might this have consequences I am not seeing ?

K

 

if ((friendlyUrl == null)||(!friendlyUrl.FoundFriendlyUrl))
{

move here ?


if ((useFolderForSiteDetection) && (virtualFolderName.Length > 0))
{
    ... 

   string pathToUse = requestPath.Remove(0, virtualFolderName.Length + 1); //does the cutting

 ...

}

else
{

   move up and remove else branch ? (sets page not found if no extention)

}

return;}}

5/8/2012 1:30:45 PM
Gravatar
Total Posts 18439

Re: Extentionless url in multi folder based site

Hi Ken,

Thanks for the bug report. I've just pushed a fix for this to the source code repository.

Just needed to make sure the requestPath actually contains the virtualFolderName:

if (
(useFolderForSiteDetection)
&& (virtualFolderName.Length > 0)
&&(requestPath.Contains(virtualFolderName))
)
{

Now it correctly results in page not found rather than an error.

Best,

Joe

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