Laravel routing - shorten the urls upto only one URI segment -
i have following urls:
1.need change from:
localhost/laravel/page/about-us/ to
localhost/laravel/about-us/
laravel's routing 1 of primary functionalities of framework, if can't use suggest read documentation.
i think first example explicit enough:
route::get('/', function() { return 'hello world'; }); this route catches of requests sent / url (the base url)
so, should have @ \app\http\routes.php file , replace line starts :
route::get('page/about-us', function() ... with:
route::get('about-us', function() ... and since seem using xampp or other easyphp friends, should rename base directory laravel laravelproj if want available http://localhost/laravelproj instead of http://localhost/laravel.
defining the default .htaccess file should help:
options +followsymlinks rewriteengine on rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^ index.php [l] if doesn't answer question, think need more explicit.
Comments
Post a Comment