Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

Redirecting the URL to other and user cannot see the redirected URL

I need a help in creation of irule to apply on the pool. The irule should redirect the URL to the original URL in the backend. The user should not see the 302 redirect, he should only see the URL and not the original redirected URL.

Need to re-write http://abc.xyz.com/proxy.pac to http://abc.xyz.com:4713/files/proxy.pac on the backend. The user should only see the first URL in their browser (not a 302 redirect) and in the backend it should get redirected to http://abc.xyz.com:4713/files/proxy.pac.

Kindly let me know if the below irules are correct:

1 when HTTP_REQUEST { HTTP::header replace Host " http://abc.xyz.com:4713/files/proxy.pac"; }

2

if { ([HTTP::host] equals "abc.xyz.com" ) and ([HTTP::uri] starts_with "/proxy.pac") } { HTTP::header replace Host "abc.xyz.com:4713" HTTP::header replace uri "/files/proxy.pac" }

3

when HTTP_REQUEST { HTTP::header replace Host " http://abc.xyz.com/files/proxy.pac"; }

Kincly let me know if the 1st irule is correct or the 2nd irule is correct. In case both are incorrect please tell us what should be the correct irule?

Apart from irules, can i use the rewrite profile for this..?

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Hi,

I think that the matching rule would be :

when HTTP_REQUEST { 
    if { ([HTTP::host] eq "abc.xyz.com" ) and ([HTTP::path] starts_with "/proxy.pac") } {
        HTTP::header replace Host "abc.xyz.com:4713" 
        HTTP::path "/files/proxy.pac" 
    }
}
0