Enable Directory Browsing
Customize Error Messages
Block Hot Linking/Bandwidth hogging
Want to show a “Stealing is Bad” message too?
Add this below the Hot Link Blocking code:
Stop .htaccess (or any other file) from being viewed
Avoid the 500 Error
Grant CGI Access in a directory
Change Script Extensions
Use MD5 Digests
Performance may take a hit but if thats not a problem, this is a nice option to turn on.
Save Bandwidth
Turn off
Options +Indexes
## block a few types of files from showing
IndexIgnore *.wmv *.mp4 *.avi
Disable Directory BrowsingOptions All -Indexes
Customize Error Messages
ErrorDocument 403 /forbidden.html
ErrorDocument 404 /notfound.html
ErrorDocument 500 /servererror.html
Get SSI working with HTML/SHTMLAddType text/html .html
AddType text/html .shtml
AddHandler server-parsed .html
AddHandler server-parsed .shtml
# AddHandler server-parsed .htm
Change Default Page (order is followed!)DirectoryIndex myhome.htm index.htm index.php
Block Users from accessing the siteorder deny,allow
deny from 202.54.122.33
deny from 8.70.44.53
deny from .spammers.com
allow from all
Allow only LAN usersorder deny,allow
deny from all
allow from 192.168.0.0/24
Redirect Visitors to New Page/DirectoryRedirect oldpage.html http://www.domainname.com/newpage.html
Redirect /olddir http://www.domainname.com/newdir/
Block site from specific referrersRewriteEngine on
RewriteCond %{HTTP_REFERER} site-to-block\.com [NC]
RewriteCond %{HTTP_REFERER} site-to-block-2\.com [NC]
RewriteRule .* - [F]
Block Hot Linking/Bandwidth hogging
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]
Want to show a “Stealing is Bad” message too?
Add this below the Hot Link Blocking code:
RewriteRule \.(gif|jpg)$ http://www.mydomain.com/dontsteal.gif [R,L]
Stop .htaccess (or any other file) from being viewed
order allow,deny
deny from all
Avoid the 500 Error
# Avoid 500 error by passing charset
AddDefaultCharset utf-8
Grant CGI Access in a directory
Options +ExecCGI
AddHandler cgi-script cgi pl# To enable all scripts in a directory use the following#
SetHandler cgi-script
Change Script Extensions
AddType application/x-httpd-php .gne
gne
will now be treated as PHP files! Similarly, x-httpd-cgi
for CGI files, etc.Use MD5 Digests
Performance may take a hit but if thats not a problem, this is a nice option to turn on.
ContentDigest On
Save Bandwidth
# Only if you use PHP
php_value zlib.output_compression 16386
Turn off
magic_quotes_gpc
# Only if you use PHP
php_flag magic_quotes_gpc off
0 comments:
Post a Comment