I wanna ban people from actually VIEWING the site
EX: something.glitch.me
Well you can do it in PHP, NodeJS. Which language do you want to do the ban in, because you can’t do it in client-side JS.
PHP Please (more text
<?php
$ip = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']);
$deny = array("111.111.111", "1.2.3.4");
if(in_array($ip[0],$deny))
{
header("location: http://www.example.com/");
exit;
}
?>
(replacing the dummy IPs with the IPs of the people you want to ban)
OK so I just make a .php file and put that in it
You have to install PHP on your project too. There are two ways to do it:
-
Just install PHP
-
Use Apache (this gives you more options)
Which one would you like?
Yes and no.
You can ban by IP but they can use a VPN. So you’ll have to use a VPN blocker, which will lower traffic to your site as many people do use VPN’s.
I belive that @Fionn already brought this up. The other way to do this would be to do a browser fingerprint ban, but I’m not sure if that is possible and if it is, it is likely very difficult.
I personally doubt that a browser fingerprint ban would work with glitch.
The IP ban will also only work on the *.glitch.me domain because of the reverse proxy used for custom domains.
So, to simplify it; You can ban people from your site but most methods can be bypassed.
Or will not work.
Exactly. (more text)
Add this to your glitch.json
file.
{
"install": "echo 'We Are Ready!'",
"start": "php -S 0.0.0.0:3000 -t ."
}
Yes, that should work.
ok (more textTHIS IS VERY ANNOYING ()).
Is this for Kidz? Like - we talked earlier?