4 ms·
The first one is not the real URL that you're visiting. Go to Firefox and turn off URL trimming or open the browser console and type window.location.pathname. T
by JoshMnem 9y ago
The first one is not the real URL that you're visiting. Go to Firefox and turn off URL trimming or open the browser console and type window.location.pathname. The server will add the trailing slash, but the browser will pretend that it isn't there.
Or go to http://example.com#123 http://example.com#123 or http://example.com?123 http://example.com?123 and see where you end up.
It makes things more confusing, by hiding what is really going on.
It leads to things like otherwise technically-savvy people leaving off trailing slashes on longer pathnames, which can cause other problems. For example, http://example.com/some-path http://example.com/some-path can be much different than http://example.com/some-path/ http://example.com/some-path/
Some browsers were also hiding trailing slashes on longer pathnames, which seems to have stopped (possibly due to breaking sites).
By hiding the real URLs, even programmers get confused, not just the end users.