Which webserver are you using and how was it configured? Which skeleton are you using? The “official” Slim Skeleton doesn’t contain that route, so a 404 would be expected.
If your routing script is located at /var/www/html/newsite then your Apache public HTML directory should be /var/www/html/newsite/public rather than /var/www/html (that’s what the name public is meant to imply) and the URL should be http://localhost/users/1 rather than http://localhost/newsite/public/users/1.
If you want something different, you need to tweak your configuration quite a lot. Perhaps you can put your files in a completely different location and make /var/www/html/newsite a symlink to wherever public is, or you can create an Apache Alias. In either case, I’m not sure whether Slim itself needs specific configuration.
I will work with adding a new vhost to Apache to see if that works. The odd thing is that from the machine that works, to the machine that does not, I do not see any difference in Apache config files.
The problem I was having is solved here. Apache configuration. I did not have much luck with RewriteBase, but then again I did not give it much attention. I just changed the route parameter and it worked fine.
The Apache config located /etc/apache2 apache2.conf is only slightly changed. Your root public www directory changes from AllowOverride None to AllowOverride All
Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory
then you must go into the slim skeleton to /app/routes.php and change the path to reflect your directory structure.
$app->group(’/users’ … became $app->group(’/newsite/public/users’
…
$app->group('/newsite/public/users', function (Group $group) use ($container) {
$group->get('', ListUsersAction::class);
$group->get('/{id}', ViewUserAction::class);
})