Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a website that is using Windows Server 2003. The site is called and at ip address Now when I log into the site all my relative links that are generated using NavURL (<%# NavURL("Images/Menu/img.gif")%>) are saying "" instead of "". This is causing an error because it needs to be secure. I'm sure there is a setting on the server somewhere to point to the name and not the ip, but I don't know where. Thanks for your help.

share|improve this question

migrated from Mar 17 '10 at 2:47

This question came from our site for professional and enthusiast programmers.

What is NavURL? – Jørn Schou-Rode Mar 16 '10 at 20:54
Why so uninformative title? – Dmitry Mar 16 '10 at 21:49
@Dmitry, I tried to quickly fix the title before it got moved to Server Fault (where I don't have the rep for such edits) – Earlz Mar 16 '10 at 21:50

Your NavURL() method (whether defined locally or imported from some library) contains some logic for resolving the hostname and protocol to be used in URLs. From your description, it sounds like it simply looks up an IP address for the local machine, which is not what you want.

You need to investigate where the host (and protocol) part of the generated URLs are read from. If possible, you might want to modify NavURL() to use a configuration setting containing your root URL. Alternatively, you can determine the hostname and protocol of the current request, by looking at the HTTP request headers, but be careful if you go down this route - the request headers are essentially user input, and should be treated with caution.

share|improve this answer

I was able to fix the problem by replacing NavURL with ResolveUrl. This isn't the fix I wanted but it works. I still have the exact same site running fine with NavURl on a different server so I'm sure it is a server setting somewhere, but this should do for now.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.