Last active
August 29, 2015 14:08
-
-
Save alexdumont/a9ec943b44d357b0f4dc to your computer and use it in GitHub Desktop.
No direct download with a HTACCESS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RewriteEngine On | |
| RewriteBase / | |
| # allow these referers to passthrough | |
| RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?cub3\.be | |
| RewriteRule ^ - [L] | |
| <FilesMatch "\.(mov|mp3|jpg|pdf|doc|docx|xls|xlsx)$"> | |
| ForceType application/octet-stream | |
| Header set Content-Disposition attachment | |
| </FilesMatch> | |
| # redirect everything else | |
| RewriteRule ^ http://www.cub3.be/ [R,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment