3 ms·
> The Apache servers I tested with always had support for .htaccess enabled For what it's worth, you'll find lots of people disable support for .htaccess for p
by Twirrim 8y ago
> The Apache servers I tested with always had support for .htaccess enabled
For what it's worth, you'll find lots of people disable support for .htaccess for performance reasons.
It's probably less of an issue these days, but if you support .htaccess files, apache reads the .htaccess file for the current directory, and those for every parent directory, and it happens on every single access.
So for example someone accessing http://foo.bar.com/thing/goes/here http://foo.bar.com/thing/goes/here would cause the webserver to check for and read /thing/goes/.htaccess, /thing/.htaccess and /.htaccess. If you imagine you've done the sensible thing and got your content nicely split out, you can probably see how that can hurt performance. *nix OSs will be smart and cache the content etc. but you're still wasting time on every access making sys calls.
If you put the access rules in the apache config file, everything is set-up at initialisation time and it never has to make further checks.
- blueimp 8y agoAgreed - in addition to performance issues, there are also security issues if .htaccess support is enabled - because they can override security settings. Originally the PHP example code didn't have a .htaccess file - I trusted developers that they would configure file uploads securely by themselves, e.g. via Apache configuration files. The reason I added it was to support developers on shared hosting plans without access to the Apache configuration - something which was very common back then.