Answer the question
In order to leave comments, you need to log in
How to deny project access but allow folder access in htaccess?
There is a project for which the following is written in .htaccess:
Order Deny,Allow
Deny from all
Allow from **.**.**.**
Allow from **.**.**.**
Allow from **.**.**.**
Allow from **.**.**.**
Allow from **.**.**.**
Allow from **.**.**.**
Allow from all
Answer the question
In order to leave comments, you need to log in
In theory, there are no problems, here is my stand:
find ./test/
./test/
./test/z.php
./test/.htaccess
./test/test
./test/test/z.php
./test/test/.htaccess
$ cat test/z.php
<?php echo "required<br />\n" ;?>
$ cat test/.htaccess
Deny from all
$ cat test/test/z.php
<?php require("../z.php") ;?>
<?php echo "main<br />\n" ;?>
$ cat test/test/.htaccess
Allow from all
$ wget https://my.site/test/z.php
HTTP-запрос отправлен. Ожидание ответа... 403 Forbidden
2017-02-07 16:18:30 ОШИБКА 403: Forbidden.
$ wget https://my.site/test/test/z.php -O -
HTTP-запрос отправлен. Ожидание ответа... 200 OK
Длина: 27 [text/html]
Сохранение в: «STDOUT»
equired<br />
main<br />
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question