문제

I have a main site (/site) and two hotsites (/market, /content) and 1 admin (/admin). Now I can only access the main site using localhost/site/controller, but I wanna to route all "/" requests to the main site.

For instance:

localhost/login -> localhost/site/login

The same is valid for GET and POST requests.

Any tips ?

I've tried with wildcard in laravel routes without luck.

도움이 되었습니까?

해결책

Route::any('/(:any)/(:all)', function($site, $route)
{
    return Redirect::to('site/'.$route);
});

I think something like this should work. Make sure it's at the bottom of your routes.php because routes are evaluated in the order they are registered.

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