Question

The idea is to redirect the user group A with "aaa" in their hostname to url.com/a/ and send user group B with "bbb" in their hostname to url.com/b/

Would appreciate any hint!

Was it helpful?

Solution

<?php
$path = $_SERVER["DOCUMENT_ROOT"];
//This will get the path where the user is
if($path == "a"){
Header("Location: http://url.com/b/");
//this will redirect the user to b folder
}
?>

This will redirect a user that is in the a folder to the b folder.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top