How to link a webpage to itself without first knowing its name?

href, html, hyperlink

Solution

Just use `<a href="?">Link</a>`. Nobody cares about the question mark appended to the URL. It does the requirement and that is what counts right?

Problem

To link a page to itself (e.g. http://example.com/folder/ThisPage.html), we can simply create a href as such: ThisPage.html: ``` <a href="ThisPage.html">Link</a> ``` This works, but has the disadvantage of needing to be updated when the file name changes. For example, if the file name changes to `ThatPage.html`, our href needs to change accordingly to `<a href="ThatPage.html">Link</a>`. I'm looking for an alternative without that disadvantage. I've tried: `<a href="?">Link</a>` Doesn't work as `<a href="ThisPage.html">Link</a>` does, because it appends a "blank query part" (question mark) to the URL. `<a href="">Link</a>` Doesn't work as `<a href="ThisPage.html">Link</a>` does, on some browsers (e.g. Opera). How do we link a page to itself, without having to update the relevant portion when the name of the page changes? Note: JavaScript not allowed.

Original source