Created
October 12, 2018 15:19
-
-
Save KustomDeveloper/e1e7def1e269c5426c0346ba62b0ea64 to your computer and use it in GitHub Desktop.
Restrict Direct Access To Files In Wordpress Using htaccess
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 characters
| Directions: Add this file to the bottom of your htaccess file | |
| # Restrict Direct Access To Files | |
| RewriteEngine On | |
| RewriteCond %{HTTP_REFERER} !^https://(www\.)?backyardriches\.com/ [NC] | |
| RewriteCond %{REQUEST_URI} !hotlink\.(gif|png|jpg|doc|xls|pdf|html|htm|xlsx|docx|mp4|mov) [NC] | |
| RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC] | |
| RewriteRule .*\.(gif|png|jpg|doc|xls|pdf|html|htm|xlsx|docx|mp4|mov)$ https://backyardriches.com/ [NC] | |
| # END Restrict Direct Access To Files |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment