View previous topic :: View next topic |
Author |
Message |
rodmac -
Joined: 12 Dec 2007 Posts: 3
|
Posted: Sun May 25, 2008 12:15 am Post subject: Can I block traffic to my website that uses the ip address? |
|
|
I want to block any traffic to my website that uses the ip address instead of the proper name. For example, if a user types in http://123.101.10.53 they don't get access, but if they type in http://www.mydomain.com they get in.
Is this possible, and how? |
|
Back to top |
|
|
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Sun May 25, 2008 12:24 am Post subject: |
|
|
The easiest way is to use a simple php script that is included on every page. If the referrer contains the IP, it ignores the request.
The other way is with Abyss X2, since you have to define the domain in the config. If you disable the default host, anything coming in on the IP with no referrer is ignored. _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
|
DonQuichote -
Joined: 24 Dec 2006 Posts: 68 Location: The Netherlands
|
Posted: Sun May 25, 2008 4:21 pm Post subject: |
|
|
I think referrer checking does not really help. The first visit to the site will not refer to the site itself. Also, referer HTTP headers can be easily adjusted to whatever you like.
In PHP, you could check the HTTP headers sent to your server. If HTTP/1.1 is used, a Host: header is compulsory. But you probably also block all HTTP/1.0 traffic if you rely on the Host: header. (It is probably accessible as $_SERVER('HTTP_HOST') in PHP, but I did not check that).
I never worked with URL rewriting, but maybe you could "rewrite" your own IP address to something unaccessible?
Good luck! |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Tue May 27, 2008 4:26 pm Post subject: Re: Can I block traffic to my website that uses the ip addre |
|
|
rodmac,
Are you using X1 or X2? _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
|