deny access on xampp

Derek Smalls
Derek Smalls
Eat shit!NewcastlePosts: 2,508 in Help Me!
I am currently sharing broadband with another company so we are on the same LAN. This means when I start up my xampp server, anyone on the network can type my ip address in and view all my client development sites which I don't want. I want to restrict access to localhost...and if possible, also allow access for my other devices (which I expect I can do by specifying their IP somewhere)

I've tried loads of things so far but got nowhere. Anyone know how to do this?

Comments

  • calder12
    calder12
    Senior Member Posts: 13,504 edited January 9
    Create an .htaccess file in your root and place the following, put a rule for each IP you want to allow. You can create a maintenance.html if you want if not everyone else is just going to get a 404. This should be the first set of rules in your .htaccess file after turning on rewrite and any base rewrite.
    #Maintenance
    RewriteCond %{REQUEST_URI} !/maintenance.html$
    #IP to allow
    RewriteCond %{REMOTE_HOST} !72\.38\.92\.91
    #Another IP to allow
    RewriteCond %{REMOTE_HOST} !24\.36\.135\.53
    RewriteRule $ "maintenance.html" [R=302,L]
    

    PS. You can also use this to push a site live and restrict access to you and a client, which is what I use it for.
  • Derek Smalls
    Derek Smalls
    Eat shit! NewcastlePosts: 2,508
    cheers! Simple but makes sense
Sign In or Register to comment.
© Copyright 2003 - 2016 - DT by Kooc Media