How to block unwanted bots with web.config file using Plesk?

Short tutorial on How to block unwanted bots with web.config file using Plesk?

Blocking Unwanted Spambots With Web.Config

In this article well discuss how you can block unwanted bots from accessing your website via web.config file using Plesk. Follow the steps below to block unwanted bots from being able to access your website.
Step 1: Login to your Plesk → Filemanager
Plesk Filemanager
Step 2: Select httpsdocs →.htaccess file
Httpdocs Htaccess
Step 3: Use the RewriteRule given below to block one particular User-Agent.
<requestFiltering>
<filteringRules>
<filteringRule name="BlockSearchEngines" scanUrl="false" scanQueryString="false">
<scanHeaders>
<clear />
<add requestHeader="User-Agent" />
</scanHeaders>
<appliesTo>
<clear />
</appliesTo>
<denyStrings>
<clear />
<add string="YandexBot" />
</denyStrings>
</filteringRule>
</filteringRules>
</requestFiltering>
<authentication>
<basicAuthentication enabled="true" />
<anonymousAuthentication enabled="true" />
</authentication>

Step 4: Save and upload the same. You are done.


Related Topics