.htaccess snippets

cats who code stellt 10 .htaccess Snippets vor. Unter anderem:

Force download of a specific filetype

<Files *.xls>
 ForceType application/octet-stream
 Header set Content-Disposition attachment
</Files>
<Files *.eps>
 ForceType application/octet-stream
 Header set Content-Disposition attachment
</Files>

Cross Domain Font embedding for Firefox

<FilesMatch "\.(ttf|otf|eot|woff)$">
<IfModule mod_headers.c>
 Header set Access-Control-Allow-Origin "http://yourdomain.com"
</IfModule>
</FilesMatch>

Configure your website for HTML5 videos

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
AddType video/ogg .ogv
AddType video/ogg .ogg
AddType video/mp4 .mp4
AddType video/webm .webm
AddType application/x-shockwave-flash swf

Possibly related posts (automatically generated)