Never been to DZone Snippets before?

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 (See related posts)

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]



You need to create an account or log in to post comments to this site.


Click here to browse all 4861 code snippets

Related Posts