Skip to content

Instantly share code, notes, and snippets.

@jedmund
Created March 20, 2011 00:32
Show Gist options
  • Save jedmund/877945 to your computer and use it in GitHub Desktop.
Save jedmund/877945 to your computer and use it in GitHub Desktop.
Options +FollowSymlinks
RewriteEngine on
# No intersticial for direct reference and self-reference
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://box.jedmund.com/.*$ [NC]
# Add a line item for every website you don't need an intersticial for
# I've added my own website, gmail and facebook
RewriteCond %{HTTP_REFERER} !^http(s)?://([^\.]*.)?jedmund.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://mail.google.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://([^\.]*.)?facebook.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://([^\.]*.)?twitter.com/.*$ [NC]
RewriteRule ^([^/]+)/?$ /?file=$1&referrer=%{HTTP_REFERER} [R=302,L,P]
# This directs assets the page tries to load to dropbox.com
RewriteCond %{REQUEST_URI} favicon [OR]
RewriteCond %{REQUEST_URI} static/images/psychobox\.png
RewriteRule ^(.*)$ http://www.dropbox.com/$1 [L]
# This ensures that a clean load of box.jedmund.com/ goes somewhere
RewriteCond %{REQUEST_FILENAME} index
RewriteRule \. index.php [L]
# All urls that would otherwise 404 we direct to our dropbox user account
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ http://dl.dropbox.com/u/4867222/$1 [P,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment