@newaitix

Как указать на htaccess в корневой директории?

Лежит htaccess в корневой дериктории, как для folder1, folder2, folder3 файлов указать чтоб они ссылались на дериктивы этого htaccess фала а не требовали собственный?
/
/folder1
/folder2/folder3
  • Вопрос задан
  • 2262 просмотра
Решения вопроса 1
3vi1_0n3
@3vi1_0n3
1) Включить AllowOverride
2) Цитата с httpd.apache.org/docs/current/howto/htaccess.html:
There are two main reasons to avoid the use of .htaccess files.

The first of these is performance. When AllowOverride is set to allow the use of .htaccess files, httpd will look in every directory for .htaccess files. Thus, permitting .htaccess files causes a performance hit, whether or not you actually even use them! Also, the .htaccess file is loaded every time a document is requested.

Further note that httpd must look for .htaccess files in all higher-level directories, in order to have a full complement of directives that it must apply. (See section on how directives are applied.) Thus, if a file is requested out of a directory /www/htdocs/example, httpd must look for the following files:

/.htaccess
/www/.htaccess
/www/htdocs/.htaccess
/www/htdocs/example/.htaccess
And so, for each file access out of that directory, there are 4 additional file-system accesses, even if none of those files are present. (Note that this would only be the case if .htaccess files were enabled for /, which is not usually the case.)

Там же говорится о том, чтобы избегать по мере возможности использования .htaccess и использовать
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы