Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add url extensions to Laravel routes

Is it possible to add an extension to laravel routes like so?

http://www.mywebsite.com/members/login.html

and another page with a different extension

http://www.mywebsite.com/contactus.htm

I am transitioning an old website into laravel but the owner doesn't want to change the URL for SEO purposes.

like image 970
bman Avatar asked Mar 09 '14 20:03

bman


1 Answers

Yes, this is certainly possible and very straightforward to do with Laravel.

routes.php:

Route::get('members/login.html', function() { return View::make('members.login'); } );

Then you need to create the view members/login.php or members/login.blade.php in your views directory.

like image 174
Simo A. Avatar answered Sep 30 '22 01:09

Simo A.