apache server question

I want to keep someone from viewing my site but I want them to know it by having them access my domain or any page within my domain but they’re automatically redirected to a page made up just for them.
How does one do this?

You’ll need to edit .htaccess to do a redirect for specified IPs.

Here’s a start:

http://www.javascriptkit.com/howto/htaccess5.shtml

If you’re using PHP, you can do something like



<?
if ($REMOTE_ADDR = 123.456.789) {
header("Location: screwyou.html") }
?>


The redirected person needs a static IP, though.

Whups, make that

header(“Location: screwya.html”); }

I don’t have their IP address but I do have their address which is like this:
city.state.isp.net but the stuff before it is always somewhat different. Would I be able to use * as a wildcard like this in lieu of having an IP address? Like this?

*.city.state.isp.net

Sure everyone in their city from that state wouldn’t be able to see my page but no one else from there checks out my site.

Remember that people can use web-based anonymizers to mask their ip address. They could also simply change their ISP or go to a web cafe to foil your ip address re-director.

It’s pretty much impossible to keep one person out while allowing everyone else in, it’s much easier to allow certain people in and keep everyone else out.

Do a reverse whois or nslookup on the domain, find out what IP addresses it uses, and ban the entire ISP. Or the entire top-level domain.

It’s what I typically do. Then I just wait until someone complains by e-mail, and I increase the granularity of the ban so they can get in.