I'm creating a website. The username/password to open the MySQL database is stored in a text file. I'm preventing that text file from being displayed by putting a htaccess file and htpasswd file in the same folder as the text file, which is where all the programs are. It works when I try to URL to the text file, a popup box asks for username/password authentication instead of just displaying it on screen.
But when I use a windows command prompt it still lists all the files in the folder and allows me to open the text file and see the info. How do I stop this?
My htaccess file has this code:
ErrorDocument 401 default
<FilesMatch "login.txt">
AuthName "Member Only"
AuthType Basic
AuthUserFile .htpasswd
require valid-user
</FilesMatch>
# Hide files of type .txt, .php from listing
IndexIgnore *.txt *.php