logoalt Hacker News

hannob • today at 8:43 AM • 5 replies • view on HN

Apache has a feature that no other http server has replicated: .htaccess files.

They provide limited configurability of server functionality within a webroot. That's extremely convenient for PHP webapps. For many PHP apps, deploying them on anything that is not apache means touching the server config itself.


Replies

account42 • today at 10:28 AM

I would say that's actually a misfeature as it requires too many additional filesystem lookups to fulfil requests.

Modifying the web server config is a nonissue outside of shared hosting, which should have died out with the advent of VMs/containers.

➕ show 1 reply
Alghranokk • today at 9:24 AM

Does not Microsoft's IIS also have that with web.config files?

➕ show 1 reply
ransom1538 • today at 9:17 AM

Eh. You can use .htaccess in nginx too. I use that everyday.

cyphar • today at 10:53 AM

Ah yes, htaccess. Another lovely source of security bugs for the past 30 years and may it continue to bear skiddie fruit for another 300.

Its model is fundamentally flawed precisely because it was based on the fundamentally flawed PHP model (website assets and code are stored and hosted from the same webroot). This allowed for shared hosting to exist but containers and reverse proxies are a far better way of organising such sites today.

The fact that in other webservers the server's configuration is configured through its configuration file and not the content of its webroot is a feature.

➕ show 1 reply
system2 • today at 8:47 AM

PHP can go to hell. My hair is gray because of it. Nginx is superior, and I can get anything imaginable done with config files. And not to mention, it's much faster.

➕ show 2 replies