Skip to content

Instantly share code, notes, and snippets.

@FMCorz
Created September 2, 2022 03:22
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 FMCorz/e0fbf018cfe52c0d8633c7a66c093bf4 to your computer and use it in GitHub Desktop.
Save FMCorz/e0fbf018cfe52c0d8633c7a66c093bf4 to your computer and use it in GitHub Desktop.
Restrict access to local network in Apache
<VirtualHost *:80>
DocumentRoot /var/www/dirforbidden
<Directory /var/www/dirforbidden>
# Local machine only
Require local
# Broader local network
Require ip 192.168
Require ip 10
</Directory>
<Directory /var/www/dirforbidden/dirallowed>
Require all granted
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment