This iRule work like a charm on my HTTP virtual server. However when I assign it to the HTTPS virtual server I get the following error:
- Operation not supported (line 4) invoked from within “HTTP::header replace Host “test2.domain.com””
There are other irules on the virtual server that control routing to pools based on various external class files however I am not sure how they woluld be causing the issue I am seeing /
The same irules are assigned to both HTTP & HTTPS virtual servers.
Although iRule is now working fine on both HTTP and HTTP virtual servers I have found a slight issue.
When i stay on the same VIP the irule works fine
Example:
1) If uri is http://www.test1.com and irule is set to replace host to www.test2.com and change uri to /index.html - i get re-written and sent to correct page but browser still has http://www.test1.com - This is good and is working as designed
2) if i try the same as 1) but replace protocol with https and change uri to /secure (i have another irule that picks up that /secure should be https and forces all traffic to HTTPS virtual server) this works as expected e.g. requested uri is https://www.test1.com/secure - gets re-written to https://www.test2.com/secure and browser retains https://www.test1.com/secure
I am guessing it is something to do with the other irules i have - but just wondered whether anyone had seen something like this previously? can you post the irule?
And looking at it now i guess it makes sense…the re-write from http://www.test1.com to https://www.test1.com/secure is picked up by this irule that knows /secure is HTTPS so it then does a redirect