Get rid of this line as it could cause issues - this is the IPv6 local loop back address and if you don't use IPv6 then it is safe to delete or comment out - try this first and see how you go:
::1 localhost
Please post feed back if removing the above line helps with your issue.
You should have your other domains and local IPs in the hosts file if you are accessing locally but again this depends on how your vhosts file is configured.
Just follow the commented # lines in the above hosts file for clues.
Because I did not read your first post correctly, I may have given you a fix that you may have not needed to do to get rid of the user/pass issue - however the following paragraphs will sort that out I hope and you will be able to set a user/pass again if you wish.
Your
www.mydomain.com issue not giving you the "It Works" response is very simple to fix.
When you type
www.domain.com then the index file loaded is
index.php which, in the htdocs directory is the XAMPP index file and is why it brings up the request for user/pass as you had set one in the Security section of the Welcome page.
When you typed
www.mydomain.com/index.html then this brings up the index.html file with the text "It Works" in the html source code.
To fix this just rename the
index.php in the htdocs directory to
index.php_orig and try again with
www.mydomain.com and you should see the "It Works" page.
To change this behavior on a server wide basis you will need to edit your httpd.conf file like this:
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml #
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
Change this
DirectoryIndex line so that
index.html is the first entry and before the
index.php entry - my list of index files above will be different to yours however.
When ever you type just
www.mydomain.com without a page reference then you are requesting a directory index
So the above configuration comes into play and the first index file in the list, if it exists in the directory will be sent to the browser -
index.php, so you need to change the order so index.html is first in line.
But if the first index file in the list is not present then the next in line will be looked for and served if it finds it - and so on until all index files in the list have been exhausted - the server will then give a list of files and directories within the specified directory to the browser which requested a directory index.