I want to allow access to a file (secret.txt) only from my ip. Below is the .htaccess I'm using. It works great at my provider's server. However, at my localhost this .htaccess does not allow me to access the file.
<Files "secret.txt">
order deny,allow
deny from all
allow from 1.2.3.4
</Files>
Where my external ip is "1.2.3.4"
I use Apache server locally.
How can I make things work at localhost also?