how to use relative path for external hyperlinks?

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

Hi,

our webserver is placed into our dmz connected to our local network and to
internet.
For accessing some files or directories on the websetver, i use the relative
path function: Server.MapPath("~/mydir/" & filename)
This is ok.

The dns name of our webserver is: dmz05.ourcompagny.nl .
The local name is: localdmz05 .

Now, i use this for external hyperlinks:
http://dmz05.ourcompagny.nl/mydir/link1.aspx , which is ok but i don't want
to hard-code the dns name, instead i want to also use a relative path for
external hyperlinks.

I can't use server.MapPath because its' unknown from internet.

Thanks for hint
 
Hi,

our webserver is placed into our dmz connected to our local network and to
internet.
For accessing some files or directories on the websetver, i use the relative
path function: Server.MapPath("~/mydir/" & filename)
This is ok.

The dns name of our webserver is: dmz05.ourcompagny.nl .
The local name is: localdmz05 .

Now, i use this for external hyperlinks:http://dmz05.ourcompagny.nl/mydir/link1.aspx, which is ok but i don't want
to hard-code the dns name, instead i want to also use a relative path for
external hyperlinks.

I can't use server.MapPath because its' unknown from internet.

Thanks for hint

Hi Eric

you can use Uri class

Dim myUri As New Uri("http://www.contoso.com/catalog/shownew.htm?
date=today")
Dim relativePath As String = myUri.PathAndQuery

Hope this helps
 
thanks

"Alexey Smirnov" <[email protected]> schreef in bericht
Hi,

our webserver is placed into our dmz connected to our local network and to
internet.
For accessing some files or directories on the websetver, i use the
relative
path function: Server.MapPath("~/mydir/" & filename)
This is ok.

The dns name of our webserver is: dmz05.ourcompagny.nl .
The local name is: localdmz05 .

Now, i use this for external
hyperlinks:http://dmz05.ourcompagny.nl/mydir/link1.aspx, which is ok but i
don't want
to hard-code the dns name, instead i want to also use a relative path for
external hyperlinks.

I can't use server.MapPath because its' unknown from internet.

Thanks for hint

Hi Eric

you can use Uri class

Dim myUri As New Uri("http://www.contoso.com/catalog/shownew.htm?
date=today")
Dim relativePath As String = myUri.PathAndQuery

Hope this helps
 
Back
Top