Skip to content

Instantly share code, notes, and snippets.

@filviu
Created December 2, 2015 10:33
Show Gist options
  • Save filviu/95316b779d9888578b72 to your computer and use it in GitHub Desktop.
Save filviu/95316b779d9888578b72 to your computer and use it in GitHub Desktop.
Hotlink protection
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_URI} /images/documents [OR]
RewriteCond %{REQUEST_URI} /images/stories [OR]
RewriteCond %{REQUEST_URI} /media/kunena/attachments/
RewriteCond %{HTTP_REFERER} !qgcio.qld.gov.au/.*$ [NC]
RewriteCond %{REMOTE_ADDR} !^172\.19\.2\.3$
RewriteCond %{REMOTE_ADDR} !^119\.9\.16\.90$
RewriteCond %{REQUEST_URI} !\.(jpg|png|gif)$ [NC]
RewriteRule .* https://www.example.com/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment