I'm starting to rebuild one of my websites : XPagesCheatSheet.com. One of the resources I have on that site is a little cheatsheet to help you deal with the URL from SSJS. I've created a new updated page with that information here:
XPages SSJS URL Cheatsheet.
I hope it helps anyone that needs it.