This is really basic I guess but I read frequently that using .htaccess files is a real performance killer. But it looks like this is how the Apache webserver works!
When I read the following, I wonder how bad of an idea the concept is and especially on a shared server, where the look-up for this file throughout potentially multiple levels of directories would be further multiplied by the number of domains hosted!! ??
If .htaccess files are allowed (through the AllowOverride directive) then apache will look for .htaccess files on every request. In addition apache has to look up the directory tree to see if there are further .htaccess files in locations above the location the file is requested from so that it can tell which directives have precedence. For example: if you request a file from /foo/bar, apache has to look for /foo/bar/.htaccess, /foo/.htaccess and /.htaccess and that’s even if there are no .htaccess files present in any of those locations! Once a .htaccess file is found it has to be parsed and don’t forget all of this has to happen for every request!!
As there’s nothing in a .htaccess file that can’t be achieved in your httpd.conf (or files included by httpd.conf) it makes sense to move existing .htaccess rules into your apache conf using a Directory or Location directive as appropriate.
So do I understand it correctly, that anything that would be put in one or multiple .htaccess files for a website could be put into one single file called httpd.conf, that sits on the Apache webserver itself? Yet, because my reseller hosting account is in a shared hosting environment, I can't access nor do I have the right to access or modify that file?
And even if I did not actually use a .htaccess file myself, the fact that everyone else might be, can still result in .htaccess file related performance issues?
I'm just asking to understand the concept and alternative solutions.
As far as I understand, by using Wordpress, it creates a .htaccess file at root level automatically. I actually added one line to prevent directory listing across the site/s (Options -Indexes). Does that mean this will already slow down my site/s? If adding more lines or multiple .htacess files in multiple directories means a slower site, doesn't that prove that the concept of using them (even if only once in the root) is a bad concept in itself?
Also, I think plugins like Yoast's Wordpress SEO requires a .htaccess file, but I am not sure.
Would all of this be resolved by moving to a VPS? Do I get my own Apache webserver and httpd.conf file there, or is this still under the limits of shared hosting in this regard?
Are there alternatives to what looks like another reason why it seems that Apache is not really helping with running fast performing websites/blogs?
I've heard of NGINX and LiteSpeed, but not sure how they compare to Apache regarding the need/performance/replacement of .htaccess files? How does a Wordpress site run on either, if a .htaccess file seems to be needed for WP?
EDIT: This is vital for me to understand, as I am looking for new reseller hosting and I am unsure what webserver technology would be the wisest to choose in a hosting provider. Down the track I may anticipate a VPS, but for now reseller hosting for my own sites should do.