Can I block traffic to my website that uses the ip address?

 
Post new topic   Reply to topic    Aprelium Forum Index -> Web Design
View previous topic :: View next topic  
Author Message
rodmac
-


Joined: 12 Dec 2007
Posts: 3

PostPosted: Sun May 25, 2008 12:15 am    Post subject: Can I block traffic to my website that uses the ip address? Reply with quote

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 View user's profile Send private message
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Sun May 25, 2008 12:24 am    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website
DonQuichote
-


Joined: 24 Dec 2006
Posts: 68
Location: The Netherlands

PostPosted: Sun May 25, 2008 4:21 pm    Post subject: Reply with quote

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 View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Tue May 27, 2008 4:26 pm    Post subject: Re: Can I block traffic to my website that uses the ip addre Reply with quote

rodmac,

Are you using X1 or X2?
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Web Design All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group