Relative path for your Visualforce page: ApexPages.currentPage().getUrl();
Hostname of your salesforce org: ApexPages.currentPage().getHeaders().get(‘Host’);

The complete code for constructing the absolute path for a Visualforce page is below:
String hostname = ApexPages.currentPage().getHeaders().get(‘Host’);
String pageUrl = ApexPages.currentPage().getUrl();
String absolutePath = ‘https://’ + hostname + pageUrl;

Ack : Jesse Lorenz