Page 1 of 1

Base URL of web address

Posted: Sun Jan 06, 2013 4:52 am
by MachineCode
I need to get the base URL of a web address, ie. the "http/https" + domain of any given address. But the GetURLPart() command doesn't have an easy way to get it.

In the code below, I want the output to return: https://mail.yahoo.com

Code: Select all

Debug GetURLPart("https://mail.yahoo.com/login.css",#PB_URL_Site)
But it returns only: mail.yahoo.com (which doesn't show if it's http or https). :( So I have to resort to hacking my own:

Code: Select all

Debug GetURLPart("https://mail.yahoo.com/login.css",#PB_URL_Protocol)+"://"+GetURLPart("https://mail.yahoo.com/login.css",#PB_URL_Site)
So, a new parameter (maybe #PB_URL_Base?) would be great:

Code: Select all

Debug GetURLPart("https://mail.yahoo.com/login.css",#PB_URL_Base)