Bad reference of styles and scripts in cakephp 4.2

I made a site with cakephp 4.2 and when I see the source of that site is referencing bad the css and js scripts because it adds me a folder that shouldn’t be there, this is the image with the site source:


As you can see the folder that shouldn’t appear is marked with a circle.
What should I do to make disappear that folder?

How does your .htaccess look like? How does your Folder Structure look like?
Please check also this Reference: Installation - 4.x

This is how it looks .htaccess:

# Uncomment the following to prevent the httpoxy vulnerability
# See: https://httpoxy.org/
#<IfModule mod_headers.c>
#    RequestHeader unset Proxy
#</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^(\.well-known/.*)$ $1 [L]
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]
</IfModule>

And this image shows the folder structure:

because I have no clue on .htaccess files, i can only show my files, but can’t explain them.

<IfModule mod_rewrite.c>
    RewriteEngine on
    #the next is for forwarding to https
    RewriteCond %{SERVER_Port} !=443
    RewriteRule ^(.*)$ https://alltime.recipes/$1 [R=301,L]
    # end of forwarding

    RewriteBase /
    RewriteRule ^(\.well-known/.*)$ $1 [L]
    RewriteRule ^$ webroot/ [L]
    RewriteRule (.*) webroot/$1 [L]
</IfModule>

and there should be another htaccess file in your webroot folder:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

maybe it helps, but as I said, i can’t explain these files:-)

Hi,

how have you configured which favicon is loaded? Have you configured it at all?

For myself, I have a layout file where I configure my specific favicon using HtmlHelper’s meta() method.
Like:

<?= $this->Html->meta('my_favicon.ico', '/my_favicon.ico', ['type' => 'icon']) ?>

See:
https://book.cakephp.org/4/en/views/helpers/html.html#creating-meta-tags

I would try this:
d:\matias\PHPEdit\PDO\programas_assignaturas.htaccess
The htaccess on you local machine should read

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^(\.well-known/.*)$ $1 [L]
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]
</IfModule>

However on the web server:
/var/www/html/sitemas/programas_assignaturas/.htaccess

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /
    RewriteRule ^(\.well-known/.*)$ $1 [L]
    RewriteRule ^$ webroot/ [L]
    RewriteRule (.*) webroot/$1 [L]
</IfModule>

The difference is using the “RewriteBase /”