|
|||||||
| PHP Discussion and technical support for using and deploying PHP based websites. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Make it so only specified IP address can see site
In PHP, how can I make it so only a specified IP address can see a website? All other users will be directed to another website?
__________________
Registered Linux User: #463250 ----------------- HELPFUL LINKS PHP - http://www.php.net Website Color Schemer - http://www.colorschemer.com/online.html |
|
#2
|
||||
|
||||
|
PHP Code:
__________________
"That's what the gods are! An answer that will do! Because there's food to be caught and babies to be born and life to be lived and so there is not time for big, complicated, and worrying answers! Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." -- from Nation, by Terry Pratchett freelancer.internet.com Email me |
|
#3
|
||||
|
||||
|
OP: Please be informed - if the visitor comes through a proxy or firewall on their end their WAN IP might be the same as anyone else on their LAN. So you might intend to block one user but might end up blocking many sharing that IP. Plus if your filter allows wildcards to ban ranges, one typo and you could ban an entire class C, B or huge block of unintended addresses with one unnoticed typo. And even proxy servers can be used to bypass an IP ban anyway unless you implement an anti-blocking script. In short, there are a few notable potential headaches if this kind of policy is not applied sensibly and carefully.
-jim |
|
#4
|
||||
|
||||
|
Quote:
In either case, this could also be handled at the web server level such as limiting access to a directory via a .htaccess entry (if Apache), though I'd have to do a little Googling to come up with the syntax for that.
__________________
"That's what the gods are! An answer that will do! Because there's food to be caught and babies to be born and life to be lived and so there is not time for big, complicated, and worrying answers! Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." -- from Nation, by Terry Pratchett freelancer.internet.com Email me |
|
#5
|
||||
|
||||
|
Quote:
![]() -jim Last edited by SrWebDeveloper; 11-24-2009 at 02:28 PM. Reason: Fixed the quote tag |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|