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

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -