Forum Moderators: open
Right Now I have the URL hard coded in a few locations where relative paths don't work. THe problem is that as I move between the real site and the test site, the domain changes and I have to manually change the code.
There must be an object that returns the domain or the URL....I Hope.
TESLA
For example
the page is domain.com/pages/page1
the function returns /pages/page1
This is the exact code I used.
<% response.write request.ServerVariables("URL") %>
AND
<% response.write request.ServerVariables("script_name")
returns the same thing.
<% response.write request.ServerVariables("server_name") %>
This seems to work.
[edited by: tesla at 2:03 am (utc) on Aug. 10, 2002]
I don't know what your configuration is. If HTTP_HOST doesn't work try concatinating SERVER_NAME with URL. You may want to use the server variable code to check them all out.
<%
response.write "<table border=2>"
For Each Item in Request.ServerVariables
response.write "<tr><td>" & Item & "</td><td>" & Request.ServerVariables(Item) & "</td></tr>"
Next
response.write "</table>"
%>