Get Absolute Path (JavaScript)
function getAbsolutePath(url) { return url.match(/^\w+:\/\/[^\/]+\/*(?:[^\/\.]+(?:\r|\/+))*/)[0]; }