Reputation: 1145
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.
Upvotes: 2
Views: 281
Reputation: 938
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.
Upvotes: 1