I need check domain for some routes. Then after check, I need redirect domain https://two.com to https://one.com with middleware in laravel.
For example:
Routes:
Route::get('/', ['as' => 'index', 'uses' => 'IndexController@index']); Route::get('termsAndCondition', ['as' => 'termsAndCondition', 'uses' => 'IndexController@termsAndCondition']); Route::get('aboutUs', ['as' => 'aboutUs', 'uses' => 'IndexController@aboutUs']); Route::get('privacy', ['as' => 'privacy', 'uses' => 'IndexController@privacy']); I need check aboutUs and privacy for domain name.
If domain name is https://two.com/aboutUs or https://two.com/privacy redirect to https://one.com/aboutUs or https://one.com/privacy.
I need check with middleware.
Thanks.