Hi,
This has got me really baffled.
This has got me really baffled. When I run Dim url As String = HttpContext.Current.Request.Url.AbsolutePath.ToLow er from Application_beginRequest in Global.asax with server that ships with Visual Web Developer everything works as expected.
However, today when I tried to move all code onto IIS server this just doesn't return the same URL!
On localhost (Visual Web Developer), variable url is /sandbox/my/home/page, but on IIS it returns /sandbox/index.aspx.
Yes, this is another HttpContext.RewritePath application which is why I need to know what the user types as a URL event though a 404 error is expected.
Let's say my root directory has only the following files:
* index.aspx
* web.config
* global.asax
When the user visits, for example: http://www.mysite.com/tutorials/tute/1
The global.asax file should be able to grab this URL using HttpContext.Current.Request.Url.AbsolutePath.ToLow er method and I will use this string to formulate a RewritePath to index.aspx?a=tutorials&tute=1.
As you can see, the directories tutorials, tute and 01 don't exist, so there is no index.aspx file to refer to.
My problem is, IIS and HttpContext.AbsolutePath isn't giving me http://www.mysite.com/tutorials/tute/1 or any of the variables. But the strange thing is, this is all working on localhost.
So it makes me wonder if it's something to do with IIS, or if there is another way to get the typed URL.
Any help is greatly appreciated.
Thanks,
Jason.