Need help in redirection

Hi,

I need help as we have a requirement to redirect from one site to another site by keeping all content after / as same…example..if user tries to access abc.com/aa it should redirect to def.com/aa...similarly if he tries to access abc.com/bb it should get redirected to def.com/bb.

Any help is appreciated.

You can create an iRule using the HTTP:path to check what the user is accessing, and also HTTP::redirect to redirect the client to the new URL.

This page has examples you can use to create the iRule:

Dixit,

Use the following iRule :

when HTTP_REQUEST {
  HTTP::respond 301 Location http://nameofyournewsite.com[HTTP::uri]
}

Just replace 301 by 302 if it’s temporary and replace [HTTP::uri] by [HTTP::path] if you wish to keep the path but not the query string. [HTTP::uri] will keep both path and query string.