-5

I want to block a IP to view my URL, block it from www.example.com/{anything behind it}

I don't want to send the IP to a page but the IP must think the website can't be loaded like if the IP is writing a not available URL.

So working must be, catch IP of visitor,

if (visitor_ip === 'this.ip.adres') do not allow this user to go to my index

  • @Derek 朕會功夫 What makes you think this is a duplicate? It most certainly isn't. The person posting this question said nothing about Node.js. – Brad Sep 01 '14 at 22:36
  • @Brad - Since IP blocking is usually done on the server-side, server-side JavaScript was assumed. Since no specific framework is specified, the most popular server-side JS framework on SO (most tagged) was assumed. Until the OP has specified those details, I believe that is a legit duplicate. – Derek 朕會功夫 Sep 01 '14 at 22:41
  • @Derek朕會功夫 Even if we were talking Node.js, there is the specific requirement of not accepting the connection at all. The question you linked to does not have this requirement, and the only answer posted there definitely does not abide by this requirement. – Brad Sep 01 '14 at 22:59

1 Answers1

0

You can't block an IP from a URL, but you can configure the host to not accept connections from a specific IP address.

You can either use firewall rules to not respond to the SYN packet (most stealthy), or configure the web server to reject the connection (doesn't rely on system but it is a forceful rejection).

It's impossible to help you further as your question didn't specify OS or web server. At this point, Google for info on your firewall and/or server configuration.

Brad
  • 159,648
  • 54
  • 349
  • 530