Why do HTTP servers forbid underscores in HTTP header names

They are not forbidden, it’s CGI legacy. See “Missing (disappearing) HTTP Headers“. If you do not explicitly set underscores_in_headers on;, nginx will silently drop HTTP headers with underscores (which are perfectly valid according to the HTTP standard). This is done in order to prevent ambiguities when mapping headers to CGI variables, as both dashes and … Read more

How to prevent http file caching in Apache httpd (MAMP)

Tried this? Should work in both .htaccess, httpd.conf and in a VirtualHost (usually placed in httpd-vhosts.conf if you have included it from your httpd.conf) <filesMatch “\.(html|htm|js|css)$”> FileETag None <ifModule mod_headers.c> Header unset ETag Header set Cache-Control “max-age=0, no-cache, no-store, must-revalidate” Header set Pragma “no-cache” Header set Expires “Wed, 11 Jan 1984 05:00:00 GMT” </ifModule> </filesMatch> … Read more

Accessing localhost (xampp) from another computer over LAN network – how to?

Localhost is just a name given for the loopback, eg its like referring to yourself as “me” .. To view it from other computers, chances are you need only do http://192.168.1.56 or http://myPcsName if that doesnt work, there is a chance that there is a firewall running on your computer, or the httpd.conf is only … Read more

htaccess remove index.php from url

The original answer is actually correct, but lacks explanation. I would like to add some explanations and modifications. I suggest reading this short introduction https://httpd.apache.org/docs/2.4/rewrite/intro.html (15mins) and reference these 2 pages while reading. https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html https://httpd.apache.org/docs/2.4/rewrite/flags.html This is the basic rule to hide index.php from the URL. Put this in your root .htaccess file. mod_rewrite must … Read more

How do I disable directory browsing?

Create an .htaccess file containing the following line: Options -Indexes That is one option. Another option is editing your apache configuration file. In order to do so, you first need to open it with the command: vim /etc/httpd/conf/httpd.conf Then find the line: Options Indexes FollowSymLinks Change that line to: Options FollowSymLinks Lastly save and exit … Read more

How to Set AllowOverride all

In case you are on Ubuntu, edit the file /etc/apache2/apache2.conf (here we have an example of /var/www): <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> and change it to; <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> then, sudo service apache2 restart You may need to also do sudo … Read more

Apache and Node.js on the Same Server

Great question! There are many websites and free web apps implemented in PHP that run on Apache, lots of people use it so you can mash up something pretty easy and besides, its a no-brainer way of serving static content. Node is fast, powerful, elegant, and a sexy tool with the raw power of V8 … Read more