문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

Route::get('{id}-{another_id}.html', 'Controller@view')
        ->where('id', '.*?')
        ->where('another_id', '\d+');

Something like this

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top