Rather than monkeying around with the .htaccess, would it be possible to simply store the *.txt files above the webroot somewhere? It would be much simpler and if you REALLY don't want to allow access to the text files this is where they probably ought to be anyway.
That said, if you need to keep things the way they are then (depending on your application) you may need to use your host server's actual IP address rather than 127.0.0.1.
For example, I believe if you're using file_get_contents with a full URL to your text files (as opposed to using the local filepath) you are making an HTTP request and the IP address in use will be the proper public IP address of the server instead of 127.0.0.1.
If that doesn't apply to you, then I'm not sure why this isn't working already.