.htaccess snippets

10 .htaccess snippets von cats who code. Unter anderem:

Prevent hotlinking
RewriteEngine On
#Replace ?mysite\.com/ with your blog url
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
#Replace /images/nohotlink.jpg with your "don't hotlink" image url
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpg [L]

Force download of specific files
<files *.xls>
ForceType application/octet-stream
Header set Content-Disposition attachment
</files>
<files *.eps>
ForceType application/octet-stream
Header set Content-Disposition attachment
</files>

Possibly related posts (automatically generated)