Suppose that the user is currently located http://www.example.com/folder1/folder2/. I would like to be able redirect them to the home page at http://www.example.com/. The catch is, I don’t know I’m two folders deep and I don’t know what the domain name is. To do this, what should the href be in a link? For example, href='../../' would seem to work if I know a priori I’m two folders deep, but in general I won’t know that. I want a link that will always direct me right to the home page, regardless of how ‘deep’ I am and regardless of the domain name of the site. How do I do this?
Thanks in advance!
Try using a root-relative link, which starts at the root of the site and builds outward. In this case, you want to go directly all the way to the root, so your path would just be
/: