If I go to a web site with a default page set, the name of the page is not shown in the URL, which is a correct behaviour. The problem is that I can't detect this page as a referrer after going to some other page. Is there a solution for this? Can I find a referrer even in case of the default page? Or can I use URL rewriting to modify the URL to always show the default page? If I can, how?
Thanks for any help,
Look at my answer in this topic.
** Please mark as ANSWER if my reply helped you
The code runs at ISP's so I don't have any permissions to make any changes in IIS config.
Maybe URL rewriting would solve my problem?
You can rewrite in global.asax. There are many ways of doing it. Here is one of them:
SubApplication_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
Dimcontext As HttpContext = HttpContext.Current
Ifcontext.Request.Url.ToString.ToLower = "http://www.chapterzero.co.uk" Then
HttpContext.Current.Response.Status ="301 Moved Permanently" HttpContext.Current.Response.AddHeader("Location", "http://www.chapterzero.co.uk/default.aspx")
-- OR --
HttpContext.Current.Response.Status ="301 Moved Permanently"HttpContext.Current.Response.AddHeader("Location", Request.Url.ToString().ToLower() & "default.aspx") End If