Suppose u have the whole URL as: < https://cs14.salesforce.com/apex/myVFpage?id=906F00000008w9wIAA > String baseURL = URL.getSalesforceBaseUrl().toExternalForm(); // it will return: < https://cs14.salesforce.com > String PageURL = ApexPages.currentPage().getUrl(); // it will return: < /apex/myVFpage?id=906F00000008w9wIAA > So to get your whole exact URL you can write: String wholeURL = baseURL+PageURL; // it will return: < https://cs14.salesforce.com/apex/myVFpage?id=906F00000008w9wIAA >