Maker tech hub — AI · 3D print · Pi · ESP32 · plus the classic tech archive.

Free ESP32 kit · Books · Network Ninja · Archive

Classic tech archive. From the original averyjparker.com tech blog — historical context; pair with modern guides where noted. Full archive · Maker projects · Network Ninja

Classic tip · Classic

Saving you from yourself or specifying which index file to use with apache

As I said, I mistakenly uploaded a page of links that I use for the main administration across many sites to this domain. Unfortunately, the server preferred using the index.html to the index.php tha…

Written by

Avery J. Parker

IT veteran, maker educator, and author of Network Ninja, 3D Printing Mastery, and AI Workflow Mastery. Business IT: Diversified Tech Solutions.

As I said, I mistakenly uploaded a page of links that I use for the main administration across many sites to this domain. Unfortunately, the server preferred using the index.html to the index.php that serves up the USUAL home page. So, for about an hour after my slipup.... the main page for this site showed a page full of links to admin logins/stat monitors, google utilities, etc. etc. (At least I'm not dumb enough to have put in password information.) Anyway.... I thought, how should I protect myself from doing that again? .htaccess is the answer....


Apache has a number of configuration options and many can be specified or over-ridden from your .htaccess file in the folder you want to affect. In this case, here's what I added....

DirectoryIndex index.php index.html

(Because I ALWAYS want the index.php to take priority over the index.html)....

Now, if only I can make that USB hand that slaps you everytime you do something stupid I'll be all set. (Seriously, 5v USB power might be enough to use one of those "wavy" hands you used to see in the back of car windows give a spasmic swat towards the hand at the mouse button.... maybe use some sort of motion sensor? or tie it in with the message bus to trigger.... oh nevermind...)