mlaville/px-layout/master/acces/.htaccess - Htaccess File

mlaville/px-layout/master/acces/.htaccess

# ------------------------------------------------------------------------------------------------------------------------
# This is a comment that will be ignored by the server, note the # at the start of the line to indicate this.
# This is an example file, and will need to be adjusted to suit your needs.
# You can delete segments or copy and paste .htaccess rule segments from the article here, using comments to let you know what's going on.
# ------------------------------------------------------------------------------------------------------------------------

# Error Pages (404-error.html can be called anything)
ErrorDocument 404 /404-error.html

# 301 Redirect of all http requests to a new domain (change newdomain to your domain name)
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !newdomain.com$ [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301] 

# Cache Certain file types, saves bandwidth and speeds up website

# 1 MONTH
<FilesMatch ".(jpg|jpeg|png|gif|swf|css|js|ico|pdf|flv)$">
Header set Cache-Control "max-age=2629743, public"
</FilesMatch>

# 2 DAYS
<FilesMatch ".(xml|txt|php|html)$">
Header set Cache-Control "max-age=172800, proxy-revalidate"
</FilesMatch>

# Prevents Viewing of this file and poking around

# Disable directory listing from this point
Options -Indexes

# Prevent viewing of htaccess
<Files ~ "^.ht">
order allow,deny
deny from all
satisfy all
</Files>

# Force all PDF files to download
# Requires Apaca Header Module - this will work for any file extensions you choose to put into the FilesMatch argument!

<FilesMatch ".(?i:pdf)$">
  ForceType application/octet-stream
  Header set Content-Disposition attachment
</FilesMatch>

On Github License

Files

Download PDF of Htaccess file
HTTP_HOST

Comments

Apache