How To Deny Access To No Referrer Requests With .htaccess

In this article, we will talk about how to deny access to no referrer requests. Believe it or not, but it’s a phenomenal trick. This method will definitely protect your website from a huge amount of spam. It’s also a great way to protect your website’s login form from brute force attacks. Automated spambots comments to your website directly from the comment form. This code will prevent all the spambots who aren’t submitting the login or comment form from accessing it.

Add following code to your .htaccess file:

Replace example.com in above code with your website’s URL. Above code is basically for WordPress. So, let me break the important lines to you for using it with other platforms.

You need to replace the following line in above code with the URL of your form:

If you’re only protecting a single form, use this code:

That’s it!