I am working with a Linux server and believe I can use the web.config file to action the command below.
I want to block certain URL’s and below is an example of one, but the one below is a direct link, and what I would like to do is block the whole domain.
directorylinkhub.com/index.php?q=pendulumofmayfair.co.uk
This is what I am attempting to do.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="RequestBlockingRule1" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions>
<add input="{HTTP_REFERER}" pattern="*.directorylinkhub.com*" negate="false" />
</conditions>
<action type="Redirect" url="http://www.directorylinkhub.com"/>
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
I will need to block a few domains and the one above is the first one, and so to use multiple blocks I simply add this below the first block
<rule name="RequestBlockingRule2" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions>
<add input="{HTTP_REFERER}" pattern="*.directoryleader.co.uk*" negate="false" />
</conditions>
<action type="Redirect" url="http://www.directoryleader.co.uk"/>
</rule>
Cheers