Slim 3 PHP Routes Return 404 Page Not Found

If your routes give you a 404 error when removing the localhost:8080/index.php/xxx

Ensure that your 000-default.conf or whatever you name it has AllowOverride All


    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/public

    ServerName "dev.local"
    ServerAlias "www.dev.local"

    
        Options -Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn
    ErrorLog /var/www/html/logs/error.log
    CustomLog /var/www/html/logs/access.log combined

Ensure that a .htaccess file is in the same folder as the index.php, and the contents are


    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ index.php [qsappend,last]

Restart/reload apache apache

sudo service apache2 reload
service apache2 restart
service httpd reload
//For whatever flavor your running