Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top