I am trying to redirect url if subdomian is exist .
$link=Request::fullUrl();
$parsedUrl = parse_url($link);
$host = explode('.', $parsedUrl['host']);
$subdomain = $host[0];
if ($subdomain==true){
$name =User::where('name', $subdomain)->first();
//die('error');
$redi=url('/') . '/?ref=' .$name->id;
error_reporting(E_ALL | E_WARNING | E_NOTICE);
ini_set('display_errors', TRUE);
flush();
header("Location:https://sanjay.agelesszen.com/".'?ref='.$name->id);
die('should have redirected by now');
}
This Header redirection is working.
header("Location:https://agelesszen.com/".'?ref='.$name->id);
But when I am trying this .Its showing many redirection
header("Location:https://sanjay.agelesszen.com/".'?ref='.$name->id);.
Question is that .can I control this wiht crate route in web.php
Please help me regarding this if any solution is exist Thanks
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire