N
N
newaitix2015-02-17 23:33:48
Apache HTTP Server
newaitix, 2015-02-17 23:33:48

How to point to htaccess in root directory?

Htaccess lies in the root directory, how to specify for folder1, folder2, folder3 files that they refer to the derivatives of this htaccess file and do not require their own?
/
/folder1
/folder2/folder3

Answer the question

In order to leave comments, you need to log in

1 answer(s)
3
3vi1_0n3, 2015-02-18
@newaitix

1) Enable AllowOverride
2) Quote from 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.)

It also says to avoid using .htaccess whenever possible and to use

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question