I am trying to redirect wildcrad domain to another url. Let me exapleain All thing. Route1- This route is working for main url
Route::get('/', [
'uses' => 'ProductController@getIndex',
'as' => 'product.index'
]);
Route2-
Route::group(['domain' => '{name}.example.com'], function () {
Route::get('/', function($name) {
$name = DB::table('users')->where('name', $name)->first();
return redirect('https://www.'.$name->name.'.example.com/?ref='.$name->id);
});
});
Route second is working for wildcard subdomain. What I am doing Here. Try to redirect wildcard subdomain with other url. Its Showing multiple redirection with sanjay.example.com.
I am trying to achive redirection .But stuck with multiple redirection. is it's possible with group route. Any help save my day. Thanks for reading this post
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire