javascript - Laravel - /js/app.js not found 404 error -
i installed laravel 5.4
in server /public_html/laravel/
folder. when access example.com/lavarel/public/
, works.
i copied compiled files in local public/
folder example.com/lavarel/public/
. add <script src="/js/app.js"></script>
welcome.blade.php
:
<!doctype html> <html lang="{{ config('app.locale') }}"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="csrf-token" content="{{ csrf_token() }}"> <title>laravel</title> <!-- uikit css --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.25/css/uikit.min.css" /> <!-- <link rel="stylesheet" href="assets/sass/uikit.css" /> --> <!-- jquery required --> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!-- uikit js --> <script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.25/js/uikit.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.25/js/uikit-icons.min.js"></script> <!-- fonts --> <link href="https://fonts.googleapis.com/css?family=raleway:100,600" rel="stylesheet" type="text/css"> </head> <body> <div id="app" style="background:#666;height: 100vh;"> <router-view></router-view> </div> <script src="/js/app.js"></script> </body> </html>
but when go example.com/lavarel/public/
again, got 404 error
:
get example.com/js/app.js 404 (not found)
if change <script src="/laravel/public/js/app.js"></script>
, 404 error
:
get example.com/laravel/public/laravel/public/js/app.js 404 (not found)
how can resolve this?
Comments
Post a Comment