Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

Can anybody tell me how do i get an base url of an website or web application in an classic asp.

Like i am doing this in vb.net like the below

Dim baseUrl As String = Request.Url.GetLeftPart(UriPartial.Authority) + Request.ApplicationPath

how to convert the above in classic asp.
Posted

1 solution

Hi
I think you can use Request.ServerVariables to get the parts of the url. And combining that you will get the exact url.


For Ex:

HTML
Request.ServerVariables("HTTPS")

Request.ServerVariables("HTTP_HOST")

Request.ServerVariables("SERVER_PORT")


From the w3schools you will get some list of the useful server variables.

http://www.w3schools.com/asp/coll_servervariables.asp[^]




Regards
Dominic Abraham
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900