Вариант...
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<script>
var str = document.location.href,
reg = /[^/:]+($|\/$)/,
str = decodeURI(str);
document.write("<a href='" + str + "'>" + str + "</a><br>");
for (; reg.test(str);) str = str.replace(reg, ""),
document.write("<a href='" + str + "'>" + str + "</a><br>");
</script>
</body>
</html>