.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]

No comments:

Live Page Popularity