1

Как запретить вызов всех php файлов в папке кроме index.php с помощью htaccess?

1 ответ 1

1

Если нужно запретить вызов всех php-файлов, разрешив только index.php,то это решается так:

<Files *.php>
    Order Deny,Allow
    Deny from all
</Files>

<FilesMatch "index.php">
    Order Allow,Deny
    Allow from all
</FilesMatch>

Если нужно разрешить вызов index.php и /, то подойдёт такой вариант:

<Files *.php>
    Order Deny,Allow
    Deny from all
</Files>

<FilesMatch "^(index\.php)?$">
    Order Allow,Deny
    Allow from all
</FilesMatch>

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.