filletofish2795's avatar

Image 404 when linking into html

Images not loading, both favicon and image in header. Images are in folder images in my project directory.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
    <title>Gains House</title>
    <link rel="icon" type="image/x-icon" href="/images/favicon.ico">
</head>
<body>
    <header id="main_header"><img src="/images/gains_house.png" alt="gains">
    <nav class="main_navigation">
        <ul class="main_navigation">
            <li class="nav_buttons"><a href="Home"  id="home_button">Home</a></li>
            <li class="nav_buttons" ><a href="Sessions" id="classes_button">Sessions</a></li>
            <li class="nav_buttons" ><a href="Members" id="members_button">Members</a></li>
        </ul>
    </nav>
0 likes
1 reply
click's avatar

Images are in folder images in my project directory.

They should be in your public directory /public/images/gains_house.png so you can point to them in your html and css as /images/gains_house.png.

If this does not work you might have setup your webserver incorrectly by not making your public directory the document root of your website. https://laravel.com/docs/9.x/deployment#nginx

Please or to participate in this conversation.