When you browse to a website as http://example.com/foo/bar what is actually happening is this:
- You request http://example.com/foo/bar
- Website redirects you to http://example.com/foo/bar/
- You request http://example.com/foo/bar/
- Website looks for default entry in the directory (what that is depends on the web server) and returns that. If there is no default entry then either return a directory listing or return "Forbidden".
The default entry, as I said, depends on the web server and its settings.
Default entries include:
When operating locally and not through a web server there is no way for the filesystem to reply with a default entry as it has no concept of websites or index.html or anything like that. The sequence of events for a local filesystem would be like this:
- Open /path/to/example.com/foo/bar
- This file is a directory. Here's the list of files.
- Display the list of files.
When mirroring a website with
wget it is impossible to store the URL as a file without having a default entry file to store the data into within the directory, so it creates one (default: index.html). The --convert-links option re-writes the URLs in the files to ensure that they point to this newly created index.html file and not just the directory name.
If the website doesn't have a default entry it will send the directory listing nicely formatted (if permissions allow). This will get saved in the index.html file.
This is desirable operation as it ensures that when you click a link locally it points to the file you want to see and not the directory that contains the file. This is the whole point of using the --convert-links option. You cannot have a local copy of the website without local index.html files. Anything else would break the local copy of the site.
So no, you cannot stop --convert-links from appending index.html as it is required for it to work locally.
¹ This one is Microsoft specific - trust them to do it completely different to everyone else.