Was going to write up a little piece on how to find the current file’s directory on a webserver, but the little article below does a good job of explaining it. I use this all the time for creating my .htaccess/.htpasswd combo, but can see other times when this would be useful as well.
I’ve adopted their code snippet for my own TextExpander time saving purposes:
