php - route issue when I host my laravel 5 website on a Shared hosting -
hello i'm new on laravel. build website working on development machine when put on shared hosting 1 route working ("/"). order routes not working.
web.php (the first route working)
<?php route::get('/', function () { return view('index');}); route::group(['prefix' => '{lang}'], function(){ route::get('index', function(){ return view('index'); }); route::get('t', function(){ return view('construction'); }); route::get('post', function(){ return view('post'); }); route::get('posts', 'postcontroller@index'); }); my .htacces
<ifmodule mod_rewrite.c> <ifmodule mod_negotiation.c> options -multiviews </ifmodule> rewriteengine on # redirect trailing slashes if not folder... rewritecond %{request_filename} !-d rewriterule ^(.*)/$ /$1 [l,r=301] # handle front controller... rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^ index.php [l] # handle authorization header rewritecond %{http:authorization} . rewriterule .* - [e=http_authorization:%{http:authorization}] index.blade.php in folder views of ressources , lang files exist. if can me great
here can do..
step 1: go public folder, copy .htaccess file root (/) directory
step 2: rename server.php index.php in root folder
step 3: open vendor/laravel/framework/src/illuminate/foundation/helper.php
step 4: find code block
function asset($path, $secure = null) { return app('url')->asset($path, $secure); } replace with
function asset($path, $secure = null) { return app('url')->asset('public/'.$path, $secure); } you go.. :)
Comments
Post a Comment