<div dir="auto">Thank you very much! I did not expect to receive a reply this early, and I am really grateful for your help. Anyway, best wishes to you and your work!</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 8, 2019, 23:00 Julien Palard <<a href="mailto:julien@palard.fr">julien@palard.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Bach,<br>
<br>
> I started a local host server using python3 -m http.server<br>
> Instead of the directory, it opens "index.html" all the time.<br>
<br>
It's not even a bug, it's a convention: <a href="https://en.wikipedia.org/wiki/Webserver_directory_index" rel="noreferrer noreferrer" target="_blank">https://en.wikipedia.org/wiki/Webserver_directory_index</a><br>
<br>
In other words there's two cases:<br>
 - Either the URL points to a file, the file is served, no surprises.<br>
 - Either the URL points to a directory, and here there's a choice : Either display a "directory listing" or pick a file and display this file.<br>
<br>
I don't really know about a formal specification around "index.html", I think it's just a consensus that arose by itself, "it has always been like this".<br>
<br>
It's also documented in SimpleHttpRequestHandler:<br>
> If the request was mapped to a directory, the directory is checked for a file named `index.html`<br>
> or `index.htm` (in that order). If found, the file’s contents are returned; otherwise a directory listing<br>
> is generated by calling the `list_directory()` method.<br>
<br>
_ <a href="https://docs.python.org/3/library/http.server.html#http.server.SimpleHTTPRequestHandler.do_GET" rel="noreferrer noreferrer" target="_blank">https://docs.python.org/3/library/http.server.html#http.server.SimpleHTTPRequestHandler.do_GET</a><br>
<br>
If you think it should be documented also elsewhere, don't hesitate to propose it (like: where you searched?).<br>
<br>
> Took me 2 days to diagnose the problem<br>
<br>
I hope you learned a lot during this "trip" :)<br>
<br>
Bests,<br>
-- <br>
Julien Palard<br>
<a href="https://mdk.fr" rel="noreferrer noreferrer" target="_blank">https://mdk.fr</a><br>
<br>
<br>
</blockquote></div>