Forum Discussion
301 RESPONSE AND REDIRECT
Please help me create a custom iRule in BIG-IP WAF to issue a 301 redirect to the domain abc.bank.ca
6 Replies
- BramsBytes
Cirrus
What are the conditions u want to use this iRule for?
For a simple 301 Redirect you could use:
when HTTP_REQUEST { HTTP::respond 301 Location https://abc.bank.ca "Connection" "Close" }This will redirect all traffic on the virtual server towards the domain abc.bank.ca. Of course you could expand on this by keeping for example the URI elements attached.
Logic: if a hostname equals "test.fedbank.com" then it should respond 301 and redirect to "abc.bank.ca/,,,,,,,,,"
redirect user traffic to another URL with a 301 response using iRule.
For example, when the browser URL path is http://www.example.com/example-path and i want to redirect to http://secure.example2.com/example-path
check this
when HTTP_REQUEST { if { [HTTP::host] equals "www.example.com" and [HTTP::path] equals "/example-path" } { HTTP::respond 301 Location "http://secure.example2.com/example-path" } }
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com