Answer the question
In order to leave comments, you need to log in
How to allow access by ip in apache2?
Hello.
There is a LAN with a server. Apache 2.2 is running on the server.
Problem: you need to deny (or redirect) everyone access to the test folder in the root of the site, except for 1 ip from the local network.
I create an htaccess file in the test folder and write there:
Order Deny,Allow
Deny from all
Allow from <ip_адрес>
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !<ip_адрес>
RewriteRule /test http://адрес/ [R=301,L]
Answer the question
In order to leave comments, you need to log in
<VirtualHost 138.201.128.234:80>
/etc/apache2/site-enabled
or
/etc/httpd
In this case, they will not get into this host virtual at all and will be redirected to the default
/var/www or whatever you have installed there as garbage
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question