Apache Notes - preventing external hot links

Apache Note

Apache Notes - preventing external hot links

Troll Bot/**
.htaccess code to prevent external sites from directly linking to to files in an Apache directory. This prevent external sites from "hot-linking"
**/

SetEnvIf Referer "^http://subdomain\.domain\.edu" local_referral
SetEnvIf Referer "^https://subdomain\.domain\.edu" local_referral

# Apache 2.2
Order Deny,Allow
Deny from all
Allow from env=local_referral
Allow from env=auth_referral

# Apache 2.4 Syntax
local_referral
SetEnvIf Referer "server_23\.gluebox\.com" localreferer
Require env localreferer

#######################
// Double check for all .htaccess files in a directory
find . -name ".htaccess" -type f

// Now delete theme
find . -name ".htaccess" -type f -delete

########################
#  Enable a list of Drupal modules from a text file,
#  helpful for moving sites around
#  Make a list of all non-core modules.

sudo drush pml --no-core --type=module --status=enabled --pipe | cat > modlist.txt

# Now enable the list

sudo drush en -y $(cat modlist.txt)