Forum Discussion
Hi Ayush07 ,
Well, sorry for miss understanding.
I have simulated your scenario in my lab and I achieved it.
so look first at my lab environment and Check my script for your Environment :
> My lab iRule :
and This is the iRule Result :
where "shopping" is the Fixed part and I swapped the rest of host part , after that I redirected to new host.
> and now I have written this iRule to match your environment , in the same way I hope it works with you :
when HTTP_REQUEST {
if {[HTTP::host] contains "test.pmc.it.com"} {
HTTP::host [string map {".test.pmc.it.com" ".apps.dev2.co.it.com"}[HTTP::host]]
HTTP::redirect https://[HTTP::host]
}
}
Try it and keep me updated
GoodLuck
Leslie_Hubertus
Jan 18, 2023Ret. Employee
Hi Ayush07, did Mohamed_Ahmed_Kansoh's second reply help you? If yes, make sure to click Accept as Solution so future users facing the same challenge can easily see the solution. 🙂