HTTPArchive/httparchive/master/.htaccess - Htaccess File


DirectoryIndex index.php
Options -Indexes

<FilesMatch "(.inc|cachegen)">
order allow,deny
deny from all

<FilesMatch "admin.php">
AuthType Basic
AuthUserFile /var/www/.htpasswd
AuthName "Restricted"
require valid-user

<FilesMatch "query.php">
AuthType Basic
AuthUserFile /var/www/.htpasswd
AuthName "Restricted"
require valid-user

# Compress/gzip html, XML, css and js and fonts and CSV
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript application/javascript font/ttf application/octet-stream

# Add a far future Expires header to .gif, .jpg, .css and .js.
# TODO - Need to add a versioning system to resource URLs to make them cacheable.
<FilesMatch ".(png|gif|jpg|js|css|ico)$">
ExpiresActive On
ExpiresDefault "access plus 7 days"
Header set ETag ""

<FilesMatch "(trends|filmstrip|harviewer|interesting-images|runs|patchwork).js">
SetHandler application/x-httpd-php
Header set Content-Type "application/javascript"

# earlier I handed out and
RedirectMatch ^/dev/(.*)$$1
RedirectMatch ^/beta/(.*)$$1

On Github License


Download PDF of Htaccess file