This project is read-only.

Wrong hostname and port

May 8, 2009 at 8:16 AM

Hi, I have a problem with my BE .NET installation. I have a local server with Win 2k3 and IIS 6.0. When I access the site via my local address like myserver:83 everything works fine. If i use a external address ( via virtual server in my router ) for example I get the page also.

But the links of E-Mail, Kick It! .... are shown as that doesn't make any sense.

Any ideas how to supress this?



May 8, 2009 at 10:47 AM

So is your website bound to port 80 or 83?  If 80 works, then you shouldn't need to include 83 in the URL?

If you re-start your blog application and don't access it as myserver:83, chances are you won't see the 83 in the links.

Also, the Kick It! link is usually something like and the E-Mail link is mailto:?subject=...  You're seeing links back to your server for Kick It! and E-Mail It?

May 8, 2009 at 3:00 PM

Hi, thanks for quick answer:

The server is bounded to port 83. My router redirect the port 80 ( extern ) to port 83 ( intern ). If I access it from extern there is no port needed in the urls because it's port 80. But it is in ( maybe ) because i hosted it intern on port 83. But the url is external so it's something true and something false.

Extern:                 host:         port:80       schould be:             is:            < false


http://myserver                                 host: myserver                         port:83       schould be: http://myserver:83                         is: http://myserver:83                            < true


You know what I mean?

And Kick it! and eMail: The problem is not the target but what is sent. If i use eMail it's a function to send the articel to a friend. The url pasted in is from extern, it's wrong )


May 8, 2009 at 7:54 PM

Thanks for the explanation.  The simplest way to remove the :83 will be to make a small modification to the BE Core code and re-compile.

In the BE core code, there's a Utils.cs file with a AbsoluteWebRoot property.  The code for it is below (minus some old commented out code).  If you add the bolded part shown below, the :83 should be removed from all these links.

public static Uri AbsoluteWebRoot
        HttpContext context = HttpContext.Current;
        if (context == null)
            throw new System.Net.WebException("The current HttpContext is null");

        if (context.Items["absoluteurl"] == null)
            context.Items["absoluteurl"] = new Uri(context.Request.Url.GetLeftPart(UriPartial.Authority).Replace(":83", string.Empty) + RelativeWebRoot);

        return context.Items["absoluteurl"] as Uri;