@jrcsalter I prefer to use Serverside Up docker image instead of building it from sketch.
Not sure why my docker setup sends a 404 error when visiting localhost
So, I have been attempting to make a minimal Docker container for Apache and PHP. So far, I've done pretty well, and thought everything was going alright. I had it set up so that all 404 errors would be rerouted back to the index file so I could manually handle them. It seemed to be working, and it was. But it was also sending a 404 error when loading localhost. And because I intended for that to load the index file as well, I didn't notice it until I randomly saw the REDIRECT_STATUS in the $_SERVER array, so I'm not sure what part of my set up is causing this problem.
https://github.com/JRCSalter/jmagic/tree/dev
Edit:
So, if I go to localhost/index.php, it does not generate a 404 error. Not sure why this is.
Edit 2:
Fixed it.
So as this was a minimal install, I only loaded what I needed to get the Docker container up and running, so I removed a load of stuff that is probably important, such as some modules.
Added the following in my Apache config:
LoadModule dir_module modules/mod_dir.so
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
And now it works.
Please or to participate in this conversation.