I'm looking to get the hostname from a URL as it comes through Zeus and I've looked through the documentation on Trafficscript and it seems like the only option is regex. Doe Trafficscript have a method to return url parts?
I'm looking for something kind of like parse_url
The reason I ask is I have the following rule
$url = string.lowercase(http.getPath());
if(string.contains($url, "/simple_protected_url"))
{
http.redirect("http://mywebsite.com/");
}
The problem is we have our staging and development sites are not on the same domain name(http://mywebsite.com/
) so the rule doesn't work nicely. I want to make the rule more generic so it just redirects to the root of whatever website it runs on and need a way to figure out the host to redirect to.
Thank you