Domanda

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.

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top