Block website IP address

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sumaiya
    New Member
    • Apr 2007
    • 43

    Block website IP address

    How can I block access to my websites from all IP addresses except one.

    The application of this scenario is such that I have a website which should be accessible only from my office like a LAN application. But the website is hosted on the web thus this restriction.

    I know .htaccess can do that but i tried using it cant make head and tails out of it. So would appreciate a lot if someone out there can help me.

    Plus can anyone tell me where the feature is to activate an email from thescripts whn someone replies to my question. I checked the profile settings but no difference.

    Thanks
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    Originally posted by sumaiya
    How can I block access to my websites from all IP addresses except one.

    The application of this scenario is such that I have a website which should be accessible only from my office like a LAN application. But the website is hosted on the web thus this restriction.

    I know .htaccess can do that but i tried using it cant make head and tails out of it. So would appreciate a lot if someone out there can help me.

    Plus can anyone tell me where the feature is to activate an email from thescripts whn someone replies to my question. I checked the profile settings but no difference.

    Thanks

    $_SERVER['REMOTE_ADDR']

    Comment

    • dlite922
      Recognized Expert Top Contributor
      • Dec 2007
      • 1586

      #3
      Originally posted by sumaiya

      Plus can anyone tell me where the feature is to activate an email from thescripts whn someone replies to my question. I checked the profile settings but no difference.

      Thanks

      Click Options under settings in the main menu under the search field at the top right.

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        Like the previous posts almost said ;)
        You can get the IP of the visitor via the $_SERVER['REMOTE_ADDR'] element.

        Then you can do whatever validation on it you may need and just exit the script if it does not pass your validation, thus preventing unauthorized access.

        Comment

        Working...