HTTP Rewrite for a specific URL

Hi there,

Here was the initial URL redirection requirement;

Destination: http://www.abc.com/xyz/*

Redirection to: http://xyx.test.com/services/test.svc

Below is the redirect irule

when HTTP_REQUEST { if { [HTTP::host] equals "; and [HTTP::uri] starts_with “/xyz/” } { HTTP::redirect "; } }

Now another requirement comes up that devices can upload to a single URL and expecting reply form the same URL . Is it possible to configure a Rewrite rule not redirect?

Regards, Omar

As per iRule if both condition match then request will redirect else request will go default pool with same url. You have added twice ‘www’ in url. Is it typo? Have you applied pool to vip?

Yes, its a typo…haven’t applied pool to vip yet

Device requesting URL: http://www.abc.com/xyz/* On backend content is served by another server: http://xyz.test.com/services/test.svc Device receiving reply from: http://www.abc.com/xyz/*

How can i achieve this through Rewrite irule?

Have you tried Stream profile to VIP(Profile--> Others-->Stream)

 

Basic Stream iRule STREAM::expression