Apache web server doesn't allow me to refresh on /about but on localhost its working fine

前端 未结 2 428
旧时难觅i
旧时难觅i 2020-12-02 12:38

I bundled up one of my projects and it works fine. However when hitting refresh on a route /about, it displays The requested URL /about was not found on this server.. Howeve

2条回答
  •  既然无缘
    2020-12-02 13:17

    In case of laravel, you need to render the same view where all the routes are written for react file. Laravel route is written as:

    Route::get('{url}', function () { return view('welcome'); })->where(['url' => '.*']);

    welcome blade file is:

     
    
        
             
             
             
             Laravel
             
        
        
             

    app.js file for route

     
         
         
         
        
    

    so every time you refresh on your about route, it will show the welcome blade and its respective routes in app.js file

提交回复
热议问题