Created
July 26, 2019 15:35
-
-
Save adeel-raza/4052f3176112c45fe081c3c9d7a8f3b4 to your computer and use it in GitHub Desktop.
Prevent image hotlinking in WordPress using .htaccess
This file contains 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
#Prevent image hotlinking in WordPress | |
RewriteCond %{HTTP_REFERER} !^$ | |
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourwebsite.com [NC] | |
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC] | |
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?facebook.com [NC] | |
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?twitter.com [NC] | |
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?other-websites-go-here.com [NC] | |
RewriteRule \.(jpg|jpeg|png|gif)$ - [F] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
reference: https://serpstat.com/blog/how-to-make-your-wordpress-site-ready-for-the-mobile-speed-competition/