I'm trying to get the public site's url (ending part of it), to control show/hide some controls according to the location apex page being called.
I tried using below.
ApexPages.currentPage().getUrl()
But it doesn't show the public URL set in force.com sites, but showing apex/Pagename instead.
Can we get the public force.com site url within controller class. Any help would be great. Thanks.