Default Document Fix


https://forum.kartris.com/Topic6392.aspx
Print Topic | Close Window

By jcosmo - Tue 26 Jan 2016
I ran into an issue with admin login and main site logout running Kartris in a virtual directory. The main issue was the server didn't like that Kartris was posting back to a folder... there's an attempted fix for this in the Global.asax on line 80, but that fix is insufficient and produced a bug...

The existing logic takes requests to /admin and processes them as /adminDefault.aspx, which is invalid.

I replaced the logic with the following:
Dim strRawURL As String = Request.RawUrl.ToLower()
If strRawURL.EndsWith("/admin") Then
Response.Redirect(Replace(strRawURL, "/admin", "/Admin/_Default.aspx"))
ElseIf strRawURL.EndsWith("/admin/") Then
Response.Redirect(Replace(strRawURL, "/admin/", "/Admin/_Default.aspx"))
ElseIf strRawURL.EndsWith("/") Then
Response.Redirect(strRawURL & "Default.aspx")
End If


This resolved the admin login issue, and also resolved logout issues on the home page when the site is in a virtual directory and accessed through the default document.
By Paul - Fri 5 Feb 2016
Thanks, have updated the Global.asax with this code which will be in next release.