'Laravel images, js and files are returning a 404 (deprecated)

NOT NEEDED ANYMORE

old question: This is how the images are called:

<img src="/images/layout/incassomachtigen.png" />

The public folder is in the root so maybe that has to do with it?

My .htaccess file:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

</IfModule>

Also, some of the images have 2 slashes in the network tab:

http://localhost:8000/images//layout/intentie.jpg


Solution 1:[1]

Your internal links to images, css and js should be like this pattern. Change it related to your Laravel path.

<img src="{{ asset('images/layout/incassomachtigen.png') }}" class="" alt="">

Solution 2:[2]

use the following way. Hope this solves your problem

<img src="{{asset('/images/layout/incassomachtigen.png')}}" />

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Martin Amu
Solution 2