Jump to content

Recommended Posts

Posted

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

 

  • 2 years later...
Posted
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> 

 

Posted
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.

Posted

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 ?

Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...