Razorphyn/Extended-Comingsoon-Countdown/master/.htaccess - Htaccess File

Razorphyn/Extended-Comingsoon-Countdown/master/.htaccess

# Don't allow any pages to be framed - Defends against CSRF
Header set X-Frame-Options SAMEORIGIN
# Turn on IE8-IE9 XSS prevention tools
Header set X-XSS-Protection "1; mode=block"
# prevent mime based attacks
Header set X-Content-Type-Options "nosniff"
Options +FollowSymLinks -MultiViews

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1 [L,QSA]

RewriteCond /%{REQUEST_FILENAME}.php -f
RewriteRule ^([a-zA-Z0-9_-s]+)/$ /$1.php

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}s(.*)/index.php [NC]
RewriteRule ^ /%1 [R=301,L]

Options All -Indexes

<Files .htaccess>
order allow,deny
deny from all
</Files>

AddDefaultCharset utf-8

ServerSignature Off

############################################
## GZip Compression

<IfModule mod_mime.c>
  AddType application/x-javascript .js
  AddType text/css .css
</IfModule>
<IfModule mod_deflate.c>
  <files *.txt>
     SetOutputFilter DEFLATE
  </files>
  
  <files *.php>
     SetOutputFilter DEFLATE
  </files>
  
  <files *.css>
     SetOutputFilter DEFLATE
  </files>
  
  <files *.js>
     SetOutputFilter DEFLATE
  </files>
  <IfModule mod_setenvif.c>
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4.0[678] no-gzip
    BrowserMatch bMSIE !no-gzip !gzip-only-text/html
  </IfModule>
  <IfModule mod_headers.c>
    Header append Vary User-Agent env=!dont-vary
  </IfModule>
</IfModule>

############################################
## TRACE and TRACK HTTP methods disabled to prevent XSS attacks

    RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
    RewriteRule .* - [L,R=405]

<IfModule mod_headers.c>
  <FilesMatch ".(css|js|jpe?g|png|gif|xml|gz|ico)$">
    Header set Cache-Control "max-age=5259487, public"
  </FilesMatch>
</IfModule>
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 1 month"
  ExpiresByType text/css M5259487
  ExpiresByType text/javascript M5259487
  ExpiresByType application/x-javascript M5259487
  ExpiresByType image/jpeg M5259487
  ExpiresByType image/png M5259487
  ExpiresByType image/gif M5259487
  ExpiresByType image/x-icon M5259487
</IfModule>

# proc/self/environ
RewriteCond %{QUERY_STRING} proc/self/environ [OR]
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*(.*) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]

# Add Mime-Type for PIE
AddType text/x-component .htc

On Github License

Files

Download PDF of Htaccess file
DEFLATE, no-gzip, ORIGIN, QUERY_STRING, REQUEST_FILENAME, REQUEST_METHOD, THE_REQUEST

Comments

Apache