htaccess only accept traffic from specific http_referer
snippet in htaccess

htaccess only accept traffic from specific http_referer

user5220

RewriteEngine On
RewriteBase /

# allow these referers to passthrough
RewriteCond %{HTTP_REFERER} ^https://(protect|unprotected)\.mydomain\.com
RewriteRule ^ - [L]

# redirect everything else
RewriteRule ^ https://unprotected.mydomain.com/ [R,L]