Answer the question
In order to leave comments, you need to log in
How to restrict access to the virtual path for all IPs except one in .htaccess?
In order to restrict access to the directory for all IPs except one, you need to put .htaccess into it with the following content:
Order Deny,Allow
Deny from all
Allow from 1.1.1.1
<Directory "/var/www/html/mysite/my_folder">
Order Deny,Allow
Deny from all
Allow from 1.1.1.1
</Directory>
AddDefaultCharset utf-8
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
RewriteRule ^favicon.ico$ - [F,L]
# если директория или файл существуют, использовать их напрямую
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# иначе отправлять запрос на файл index.php
#RewriteRule . index.php <-- было
RewriteRule ^([^/].*)$ /index.php/$1 [L] # <-- стало
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question