You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Script PUT /cgi-bin/upload.cgi
Script GET /cgi-bin/download.cgi
Prevent Access to a Files
# prevent viewing of a specific file<files secretfile.jpg>
Order allow,deny
Deny from all
</files># prevent access to multiple file types<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh)$">
Order Allow,Deny
Deny from all
</FilesMatch>
Allow or deny domain access for specified range of IP addresses
# block IP range by CIDR number<Limit GET POST PUT>
Order allow,deny
Allow from all
Deny from 99.88.77.66
Deny from 99.88.77.*
Deny from 80.0.0/8
Deny from 99.88.77.66 11.22.33.44
Deny from 99.1.0.0/255.255.0.0
Deny from domain.com
</Limit># allow IP range by CIDR number<Limit GET POST PUT>
Order deny,allow
Deny from all
Allow from 10.1.0.0/16
Allow from 80.0.0/8
Allow from 99.*.*.*
Allow from sub.domain.com
</Limit>
Block Evil Robots, Site Rippers, and Offline Browsers
# password-protect single file<Files secure.php>
AuthType Basic
AuthName "Prompt"
AuthUserFile /home/path/.htpasswd
Require valid-user
</Files># password-protect multiple files<FilesMatch "^(execute|index|secure|insanity|biscuit)*$">
AuthType basic
AuthName "Development"
AuthUserFile /home/path/.htpasswd
Require valid-user
</FilesMatch># password-protect the directory in which this .htaccess rule resides
AuthType basic
AuthName "This directory is protected"
AuthUserFile /home/path/.htpasswd
AuthGroupFile /dev/null
Require valid-user
# password-protect directory for every IP except the one specified# place in .htaccess file of a directory to protect that entire directory
AuthType Basic
AuthName "Personal"
AuthUserFile /home/path/.htpasswd
Require valid-user
Allow from 99.88.77.66
Satisfy Any
Automatically CHMOD Various File Types
# ensure CHMOD settings for specified file types# remember to never set CHMOD 777 unless you know what you are doing# files requiring write access should use CHMOD 766 rather than 777# keep specific file types private by setting their CHMOD to 400
chmod .htpasswd files 640
chmod .htaccess files 644
chmod php files 600
Limit file upload size
LimitRequestBody 10240000
Secure directories by disabling execution of scripts