0) { // Append the final redirection path to the base URL $redirectPath = $baseURL . $redirectPath . "/"; // Redirect the (yours, visitor's, etc) browser to the actual location. header("Location: $redirectPath"); } else { // If the URL isn't a sub-domain, the script simply displays your original index page. } ?>