Restrict Access From Certain Refferer
-
Hello,
What I’m trying to do is to create a dummy page which has a link to /wp-admin/ and to set up .htacess to prohibit all accesses execpt with the referrer from the dummy page.
This is what I got so far. I placed this .htaccess under /wp-admin
## SITE REFERRER BANNING RewriteEngine on # Options +FollowSymlinks RewriteCond %{HTTP_REFERER} !https://[samplesite]/dummy.php [NC] RewriteCond %{HTTP_REFERER} !https://[samplesite]/wp-login.php [NC] RewriteCond %{HTTP_REFERER} !https://[samplesite]/wp-admin/* [NC] RewriteRule .* - [F]
This almost works. But when a visitor directly opens
https://[samplesite]/wp-login.php
, it just let it open. So this isn’t perfect. Also I’d like to lead visitors to a 404 page instead of a forbidden message. Is that possible?If anybody has a good way of doing this, please let me know. Thanks.
- The topic ‘Restrict Access From Certain Refferer’ is closed to new replies.