timnboys Posted December 23, 2017 Report Posted December 23, 2017 well I didn't think this would work so easy but I have to say it does: .htaccess modification: #Deny Direct IP Access RewriteCond %{REMOTE_ADDR} ^127\.0\.0\.1 [OR] RewriteCond %{REMOTE_ADDR} ^127\.0\.0\.2 RewriteRule ^ http://%{HTTP_HOST}/403.html [R=403,NE,L] ^ Do note to replace the 127.0.0.1 & 127.0.0.2 with your server actual ip addresses. also the 403 page I have on my own website https://portal.cubedata.net/403.html can be sourced here on github: https://github.com/AndiDittrich/HttpErrorPages/blob/master/dist/HTTP403.html activa 1 Quote
turner2f Posted September 16, 2020 Report Posted September 16, 2020 Thanks for sharing. Can you or someone please describe in what particular "real-world" scenario(s) would we use this ? Look forward to someone's reply. Thanks in advance. Quote
Paul Posted September 16, 2020 Report Posted September 16, 2020 5 minutes ago, turner2f said: Thanks for sharing. Can you or someone please describe in what particular "real-world" scenario(s) would we use this ? Look forward to someone's reply. Thanks in advance. I don't know how useful what the OP posted is, but it's often useful to block the entire world and allow only your IP address. This way you can test changes without the risk of someone else accessing the installation. order deny,allow deny from all allow from <your ip> Quote
turner2f Posted September 16, 2020 Report Posted September 16, 2020 OK. So this has nothing to do with preventing hackers ? This is only useful for testing and maintenance ? Quote
Paul Posted September 16, 2020 Report Posted September 16, 2020 5 minutes ago, turner2f said: OK. So this has nothing to do with preventing hackers ? This is only useful for testing and maintenance ? That's the only use case I can think of. Quote
turner2f Posted September 16, 2020 Report Posted September 16, 2020 We have at least one Department that is available to the public ( for those that are not registered ). Just curious, can this be used in reverse to block SOME IP addresses ? Would be for Brute Force or Spammers to the ticket system. If so, how ? Quote
Paul Posted September 16, 2020 Report Posted September 16, 2020 7 minutes ago, turner2f said: We have at least one Department that is available to the public ( for those that are not registered ). Just curious, can this be used in reverse to block SOME IP addresses ? Would be for Brute Force or Spammers to the ticket system. If so, how ? See https://htaccessbook.com/block-ip-address/ for more information on these kinds of rules, for blocking specific IPs while keeping access otherwise globally open. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.