var current_url = location.pathname,
location.path names returns you the path after your host name i.e. after mysite.com in your case. But there no segment after your host name, so you will not be able to find nothing.
Please find some of the properties available in window.location given below and choose respective property required for your requirement.
window.location contains
origin: "http://stackoverflow.com",
hash: "",
host: "stackoverflow.com",
hostname: "stackoverflow.com",
href: "http://stackoverflow.com/questions/26023213/if-current-url-is-something",
origin: "http://stackoverflow.com"
pathname: "/questions/26023213/if-current-url-is-home-do-something",
port: "",
protocol: "http:",
}