.htaccess is often the only file we have access to. It lives at the root of a Web site - in the same directory as the default home page of a site - and/or below that in the subdirectories for the site. Therefore, the Webmaster can upload, modify, copy, or move it at will.
However, if you administrate your own server, then you'll also have access to httpd.conf, which is one of the server configuration files. It is located along with the rest of the server files at a level that users can't get to.
Directives in httpd.conf are compiled at server start-up, so that processing is more efficient. Directives in .htaccess, however, must be interpreted for each and every HTTP request; Interpreting them slows things down a bit, and might be done 20 times to load a single HTML page with several images and scripts on it.
However, interpreting .htaccess directives is no less efficient than interpreting any other scripted language, so you do the same thing you'd do with any script that was to be run often: Decide exactly what you need to do and code it as efficiently as possible.
On the other hand, changing a directive in .htaccess does not require the server to be restarted, so some may wish to test their code by running it in .htaccess, and then 'port' it to httpd.conf once it is initially debugged. That option -- when available -- gives the best of both worlds.
However, if you administrate your own server, then you'll also have access to httpd.conf, which is one of the server configuration files. It is located along with the rest of the server files at a level that users can't get to.
Directives in httpd.conf are compiled at server start-up, so that processing is more efficient. Directives in .htaccess, however, must be interpreted for each and every HTTP request; Interpreting them slows things down a bit, and might be done 20 times to load a single HTML page with several images and scripts on it.
However, interpreting .htaccess directives is no less efficient than interpreting any other scripted language, so you do the same thing you'd do with any script that was to be run often: Decide exactly what you need to do and code it as efficiently as possible.
On the other hand, changing a directive in .htaccess does not require the server to be restarted, so some may wish to test their code by running it in .htaccess, and then 'port' it to httpd.conf once it is initially debugged. That option -- when available -- gives the best of both worlds.
0 comments:
Post a Comment