1

i have website running , that call url of some other website is there any way to block call to particular website.

For eg : inside some part of my website a call is made to url like

abc.com/xxx/aa

Please not abc.com is 3rd party website url

no i want to block any request from my server to abc.com

how can i do it.

will blocking ip of that server will work ? or should i put something in .htacess or shh to make it work

Below is what i am trying to do image url : https://pixabay.com/static/uploads/photo/2015/10/01/21/39/background-image-967820_960_720.jpg

page content:(a.php)

<img src="https://pixabay.com/static/uploads/photo/2015/10/01/21/39/background-image-967820_960_720.jpg"/>

Now i want when i open a.php

that image must not show

mdeveloper
  • 113
  • 1
  • 5

2 Answers2

1

You can use below configuration in apache to block Specific URI

<Location /xxx/aa>
     Order Allow,Deny
     deny from 255.0.0.0
     deny from 123.45.6.
     allow from all
</Location>

To block specific URL with some URI for particular IP

RewriteEngine On
RewriteCond %{HTTP_HOST} ^abc.com$
RewriteCond %{REMOTE_ADDR} ^xxx\.xxx\.xxx\.xxx$
RewriteRule ^xxx/aa? - [F,NC]
Vaibhav Panmand
  • 1,038
  • 7
  • 17
1

You can actually use iptables to block the entire url from being hit by your server, including obviously your site.

sudo iptables -A OUTPUT -d URL_YOU_WANT_TO_BLOCK -j DROP

But this might be overkill depending on your use case.

Matias Barrios
  • 213
  • 3
  • 12