php - Customizing URLs with prefix in laravel -
i have html:
<ul> <li><a href="index.php/page1">page 01</a></ <li><a href="index.php/page2">page 02</a></li> <li><a href="index.php/page3">page 03</a></li> </ul>
as can see, need use index.php/
prefix in links due server of university
(i can't change it). way done above, works fine go straightfoward home page, if try access page page, wrong url , can't access page:
examples:
home
http://localhost/php-project/public/
page1 (from home)
from: http://localhost/php-project/public/
to: http://localhost/php-project/public/index.php/page1
page2 (from home)
from: http://localhost/php-project/public/
to: http://localhost/php-project/public/index.php/page2
page1 (from page2)
from: http://localhost/php-project/public/index.php/page2
to: http://localhost/php-project/public/index.php/index.php/page1
as can see, prefix repeats itself. have no idea how work right.
any ideas?
you can use route prefix.
route::group(['prefix'=>'/index.php/'], function() { route::get('/', ['as'=>home, 'uses'=>'homecontroller@index']); //include routes here. , in view, link page route name. // eg: <a href="{{url::route('home')}}"></a> });
Comments
Post a Comment