smrubin/dtg/master/build/.htaccess - Htaccess File

smrubin/dtg/master/build/.htaccess

#Alternate default index page
DirectoryIndex index.html

#Future work: consider following protections:
#HTTP_REFERER attack protections
#additional compression
#https://github.com/nikosdion/master-htaccess/blob/master/htaccess.txt

#From https://github.com/nikosdion/master-htaccess/blob/master/htaccess.txt

########## Begin - Common hacking tools and bandwidth hoggers block
# This line also disables Akeeba Remote Control 2.5 and earlier
SetEnvIf user-agent "Indy Library" stayout=1
SetEnvIf user-agent "Wget" stayout=1
SetEnvIf user-agent "libwww-perl" stayout=1
SetEnvIf user-agent "Download Demon" stayout=1
SetEnvIf user-agent "GetRight" stayout=1
SetEnvIf user-agent "GetWeb!" stayout=1
SetEnvIf user-agent "Go!Zilla" stayout=1
SetEnvIf user-agent "Go-Ahead-Got-It" stayout=1
SetEnvIf user-agent "GrabNet" stayout=1
SetEnvIf user-agent "TurnitinBot" stayout=1
deny from env=stayout

# Disable the server signature - might be off by default on Namecheap
ServerSignature Off

# Disable directory browsing
Options All -Indexes

#Force non-www:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.dumptrumpgame.com [NC]
RewriteRule ^(.*)$ http://dumptrumpgame.com/$1 [L,R=301]

# Set browser caching to reduce http requests
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType text/css "access 1 month"
    ExpiresByType application/javascript "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 year"
    ExpiresByType text/html "access plus 0 seconds"
    ExpiresDefault "access plus 1 month"
</IfModule>

#Deny access to .htaccess file
<Files .htaccess>
Order Allow,Deny
Deny from all
</Files>

# Block access to files that can expose sensitive information.
<FilesMatch "(^#.*#|.(bak|conf|dist|fla|in[ci]|log|psd|sh|sql|sw[op])|~)$">
    # Apache < 2.3
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Deny from all
        Satisfy All
    </IfModule>
    # Apache ≥ 2.3
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
</FilesMatch>

On Github License

Files

Download PDF of Htaccess file
HTTP_HOST, HTTP_REFERER

Comments

Apache