5 ms·
Https://www.tesla.com is a different url than https://www.tesla.com/ https://www.tesla.com/ They point to different resources. Of course most people treat these
by chrismcb 9y ago
Https://www.tesla.com is a different url than https://www.tesla.com/ https://www.tesla.com/ They point to different resources. Of course most people treat these two URLs as the same, but they don't have to be.
- majewsky 9y agoDo they? They're both retrieved by issuing the same HTTP request: GET / HTTP/1.1 Host: www.tesla.com You cannot leave the path after the method empty in HTTP.
- chrismcb 9y agoThey are both retrieved because the server handles it. Of course you can leave the path empty. From the RFC: > path = path-abempty ; begins with "/" or is empty A better way to look at it is how w3.org defines it: > h t t p : / / hostport [ / path ] [ ? search ] > path : Void | segment [ / path ] Notice how the slash is in the optional part.
- JoshMnem 9y agoI've never seen a site that doesn't serve a root path. You can't serve a homepage at http://example.comindex.html http://example.comindex.html. I'd be curious to see if it's possible to serve one at http://example.com?page=home http://example.com?page=home, http://example.com#home http://example.com#home, or something like that though. In any case, http://www.tesla.com http://www.tesla.com is not the URL of their home page -- it's http://www.tesla.com/ http://www.tesla.com/ even though the browser tries to tell you that you're visiting http://www.tesla.com http://www.tesla.com.