Created
September 17, 2017 15:09
-
-
Save awakekat/a699d565b646f47a9297e2b2b2832632 to your computer and use it in GitHub Desktop.
Revisions
-
awakekat created this gist
Sep 17, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ # in htaccess # METHOD 1 # CHANGE example.com to you domain # Can add other file types <IfModule mod_rewrite.c> RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http(s)?://([^.]+\.)?example\ .com [NC] RewriteRule \.(gif|jpe?g?|png)$ - [NC,F,L] </IfModule> # in htaccess # METHOD 2 with replace img # CHANGE example.com to you domain # Can add other file types <IfModule mod_rewrite.c> RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http(s)?://([^.]+\.)?example\ .com [NC] RewriteCond %{REQUEST_FILENAME} !hotlink.gif [NC] RewriteRule \.(gif|jpe?g?|png)$ /hotlink.gif [NC,R,L] </IfModule>