Jump to content

Block Direct IP Access to Blesta using apache


Recommended Posts

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

 

Link to post
Share on other sites
  • 2 years later...
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> 

 

Link to post
Share on other sites
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.

Link to post
Share on other sites

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