DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
.htaccess Rule To Block Access To Backed-up Files
If you use vi to edit files, it leaves your backup copies with tildes at the end. Adding this to your .htaccess file (or virtual host directive in your apache conf) stops people being able to access them.
(Requires mod_rewrite)
RewriteEngine on RewriteRule ~$ - [F]




