Problem with Local directory and Mapped port virtual site

Topics: ASP.NET 2.0, Business Logic Layer, Controls
Jul 7, 2008 at 9:52 PM
Hi guys:

I am having a problem that I was trying to put BlogEngine to my local server. Since I am using a local directory to create virtual server and map to my real server using a different port number, the problem appears to BlogEngine. for instance, I set my local directory like:
DNS: bind to

my problem is:
In Utils.cs, while method AbsoluteWebRoot trying to get the absolute root URL, it is using context.Request.Url.GetLeftPart(UriPartial.Authority) which is including a port number in it. using my example, the absolute URL would be, which is incorrect. it should not use 1234 as the port, instead it should be 80.
Anybody know how to solve this?

P.S. I've tried to change the AbsoluteWebRoot to NOT use context.Request.Url.GetLeftPart(UriPartial.Authority) but generate the URL myself without a port number. it works and fix the problem, however, in a couple of pages, for example, when I click login or logout button, the page shows : Internet Explorer cannot display the webpage, but the URL is still the login page, if I refresh it, I would able to get the page display.

Anybody have any idea? Thanks a lot.