How to solve loading problem css and js laravel in production?

1

When I run my local application, styles and js are loaded normally. The css and js are in public / css and public / js.

In production are not loaded, below the production .htaccess:

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

    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /ambiente

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

App code.blade.php

<!-- Styles -->
<link href="/css/app.css" rel="stylesheet">

<!-- Scripts -->
<script src="/js/app.js"></script>

What am I doing wrong?

    
asked by anonymous 10.11.2016 / 21:12

1 answer

1

Try this, remembering that you will have to save the file with this extension .blade.php

<!-- Styles -->
<link href="{{ asset('/css/app.css') }}" rel="stylesheet">

<!-- Scripts -->
<script src="{{ asset('/js/app.js') }}"></script>
    
16.12.2016 / 16:13