Skip to content

Instantly share code, notes, and snippets.

@heymarkreeves
Created October 23, 2014 19:13
Show Gist options
  • Save heymarkreeves/005b2e9a4039bcc2cd44 to your computer and use it in GitHub Desktop.
Save heymarkreeves/005b2e9a4039bcc2cd44 to your computer and use it in GitHub Desktop.
Labeling a thief who stole your site's design
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule ^css/styles\.css$ /thief.css [L]
@heymarkreeves
Copy link
Author

If the request coming in is not via my domain (mydomain.com), then rewrite any request for styles.css to thief.css.

In thief.css, I put a tiled background image on the page that said "I'm a thief."

@heymarkreeves
Copy link
Author

That goes in your .htacces file, inside RewriteEngine On.

Here's the CSS I used in thief.css:

body > * {display: none;}
body {background:#fff url('http://www.mydomain.com/images/thief.png') !important;}
a.story-link {display:block !important; background:url('http://www.mydomain.com/images/thief.png') !important;}
a.story-link img {display:none !important;}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment