Question!
I always assumed a URL is same with or without the ending / (forward slash). How can they behave differently?The server just receives the URL from the client as a string; there's nothing in the protocol that requires a trailing slash to be ignored. Consider:
if (REQUEST_URL == "/something") send_something()
if (REQUEST_URL == "/something/") send_something_else()
Many web servers, such as Apache, helpfully adds a missing slash if it detects that the URL you're trying to access actually maps to a directory in the file system.