I tried to display the url using all sorts of methods of HttpRequest, I tried VirtualPathUtility object as well, but I never was able to display the hidden portion "default.aspx" of the default... what is the method or property that retrieves this segment of the url?
reason being, I am so close to creating a 404 on application level that catches all 404s, even html pages, by using File.Exist() on the mapped path of the url, unfortunately, that does not work on the default page.
I have seen few articles trying to do the opposite, remove default.aspx when it occurs, this is not the case here.
Edit: here is what I am trying:
string fullOrigionalpath = context.Request.CurrentExecutionFilePath.ToString();
bool newUrl = System.IO.File.Exists(context.Server.MapPath(fullOrigionalpath));
if (!newUrl) throw new HttpException(404,"page not found");
now you see, if the page is localhost/lexus/default.aspx, it works fine with no errors, but if I type in the address http://localhost/lexus/, the error is thrown, because if you try to output the fullOriginalPath, it does not have "default.aspx" part of it, so Exists returns false! do you have a better way of checking for validity of physical files?