Statis assets are not loading correctly

Hello everybody, I’m new to the Slim FW.
Appreciate a lot your help!

I have a project which works alright, the only issue is that the static assets are not loaded correctly.

php -S localhost:8080 -t public public/index.php

The assets are loaded as html which causes an error in the browser.

I followed the instructions on web server configuration, configured the .htaccess both in the root and public folder, but nothing helped.
I’m using default apache2 configuration running on Ubuntu. Is there some config I’m missing on my server in order to make it work?

I found a solution that works but I don’t think it is the best practice in Slim Framework.

Thanks for any help!

I’m not sure if this will solve your issue, but try starting the server from within the public folder, since it is the webroot.

Listening at 8888 but calling 8080 ?

My bad … I was just trying with different port and forgot to change it.
I’ve already modified it in the post.

… and you’re absolutely sure your folder structure looks similar:

        - index.php
                - util.css
                - main.css

Just by curiosity. Try with relative paths:

    <link rel="stylesheet" href=/front/css/util.css>
    <link rel="stylesheet" href=/front/css/main.css>

Thanks @darkalchemy and @tj_gumis for your help.

But sadly neither approach has worked.

I’m sure the folder structure is OK.
The problem does not seem to be with the code but with the server.
When I try to load the asset in my browser like this:
it works.