Forum Discussion
Stephane_Viau
Feb 04, 2019Nimbostratus
Hi Steve,
I think you would be looking at something like that, although I am not completely certain because I am not sure that I fully understand your post :
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"shorturl.com" {
HTTP::respond 301 Location http://www.shorturl.com[HTTP::uri]
}
"www.shorturl.com" {
HTTP::respond 301 Location http://hubspotcustomer.a4029.hubspot.com[HTTP::uri]
}
}
}
So if someone came in using shorturl.com/client1, he/she would be redirected to , and then the next request coming in for would get redirected to http://hubspotcustomer.a4029.hubspot.com/client1. The query string would follow as well if you have one as [HTTP::uri] contains both path and query string.