: 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
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.
More posts by @Karen161
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.