Gyan's avatar
Level 1

This page failed to load a stylesheet from a URL.

Hello, I have a project in which developer uses {{ url('') }} to link CSS. It work on hosted server but when I copied the project to local It not loading CSS files and also some images.

<link href="{{ url('public/new/new_design/plugins/aos/aos.min.css') }}" rel="stylesheet">
    <link href="{{ url('public/new/new_design/plugins/bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
    <link href="{{ url('public/new/new_design/plugins/smartmenus/jquery.smartmenus.bootstrap-4.css') }}"
        rel="stylesheet">
    <link href="{{ url('public/new/new_design/plugins/fontawesome/css/all.min.css') }}" rel="stylesheet">
    <link href="{{ url('public/new/new_design/plugins/bootstrap-datepicker/bootstrap-datepicker.min.css') }}"
        rel="stylesheet">

Please guide me.

0 likes
1 reply
martinbean's avatar

@gyan URLs should not have “public” in them. This suggests the app is hosted insecurely with the root directory (including sensitive files like your .env file exposed).

Please or to participate in this conversation.