Forum Discussion

MSK_222682's avatar
MSK_222682
Icon for Nimbostratus rankNimbostratus
May 27, 2016

Redirecting iRule

Hi,

 

I have a requirement from the business as below,

Currently there is a homepage of the vendor as www.abc.co.kr/ko.html (URL1)

The end users access the above homepage and then access a link on this page which directs to an application, when they do so they would see below URL on their browsers, lets refer it as URL2

https://xyz.abc.co.kr/krwebapp

Now, the requirement of the business is that when the end user access URL2 in the homepage (URL1) then the users should see below URL on their browsers instead of URL2

www.abc.co.kr/krwebapp

Can anyone please tell me if its achievable via iRules in which case would be great if you can share me the code so that I can test it.

Thanks in advance,
MSK
  • Hi,

     

    The application (URL1) should open an iframe to URL2 so that you embed the url2 content in the app referenced by the url1.

     

    You can also rewrite links to xyz.abc.co.kr in responses to www.abc.co.kr using stream profiles

     

  • Try this:

    when HTTP_REQUEST {
    if { $HOST eq "www.abc.co.kr"} {
        HTTP::host [string map {www.abc.co.kr xyz.abc.co.kr} [HTTP::host]] 
    }
    
    when HTTP_RESPONSE {
    if { [HTTP::header values Location] contains "xyz.abc.co.kr" } {
    HTTP::header replace Location [string map {xyz.abc.co.kr www.abc.co.kr} [HTTP::header value Location]]
    }
    }