Skip to content

Instantly share code, notes, and snippets.

@DomPizzie
Last active April 27, 2018 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DomPizzie/cc19c23f706a6ce5398cc834a9eb9deb to your computer and use it in GitHub Desktop.
Save DomPizzie/cc19c23f706a6ce5398cc834a9eb9deb to your computer and use it in GitHub Desktop.
Web server Lockdown
### First Method ###
<Limit POST PUT>
Order deny,allow
Deny from all
# Allow internal LAN
Allow from 10.0.0.0/8
Allow from 127.0.0.1
</Limit>
### Second Method ###
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(POST|PUT)
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$
RewriteCond %{REMOTE_ADDR} !^10\..*
# Either forbid the content, or you can redirect to specifed website
RewriteRule ^.* - [F]
</ifModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment