Its been a long time since I\'ve needed to crack open an .htaccess file...
What is the simplest way to 40x prevent access to a specific file extension through out the
I like both @Chris Lawlor's and @starkeen's answers and since OP asked about "40x" I'm going to suggest redirecting to a 404 error since it doesn't give away the fact the files exist.
This is what I'm currently using in one of my projects:
# Hide files not concerning the user
RedirectMatch 404 \.(htaccess|htpasswd|ini|log|sh|inc|bak|bkp|sql)$