Mobile app version of vmapp.org
Login or Join
Karen161

: Well, as mentioned by @Book of Zeus, this depends on how affecting are your rules. .htaccess works with a hunting process, this means... suppose you have a file being accessed at /var/www/foo/bar/baz/dir1/dir2/file.ext

@Karen161

Well, as mentioned by @Book of Zeus, this depends on how affecting are your rules.

.htaccess works with a hunting process, this means... suppose you have a file being accessed at

/var/www/foo/bar/baz/dir1/dir2/file.ext

Apache will first parse and identify if file or directory exists. Then it will check if there is any .htaccess file inside /var/www/foo/bar/baz/dir1/dir2/. If it matches, it processes and we are fine, if not, it will check the parent directory (/var/www/foo/bar/baz/dir1/) for a .htaccess and, if it encounters one, process the matching rules. If not, it proceeds to the parent and check... you got the pattern... until reach the root folder.

Summarizing, the closer to the target file the .htaccess is, higher the precedence in the hunting process.

In any case, my final suggestion is test it. Make some changes in the Apache configuration file, restart, and benchark it. Then rollback your changes a put them into a .htaccess files and run the same test. Check for response times and memory usage. Try to replicate your production load. This ca be your final silver bullet deciding which method you should adopt.

If this indicates you that changing Apache config and restart is really better, try to implement changes of the day all at once, in a nightly job run to minimize the prod impact.

PS: Apache comes with a program named "ab" - apache bench - in its default installation. You can use it to make your tests.

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Karen161

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme