Forum Discussion
tolinrome_13817
Jul 17, 2014Nimbostratus
Need to redirect to an external url
We want our users to be redirected to a secondary external url when they access the first url.
For example: When our users go to https://application.ourdomain.com (which points to our F5), I wan...
- Jul 17, 2014
You may use this irule to do so.
when HTTP_REQUEST { if { [HTTP::host] equals "https://application.ourdomain.com" } { HTTP::respond 301 Location "https://external.link.com" } }
tolinrome_13817
Jul 17, 2014Nimbostratus
Thank you for replying.
Do I need to create a vip and redirect rule or just the vip? Does ssl client need to be enabled at all?
Also, the first url users will access is http not https, so I dont know if that matters where you wrote:
"equals "https://application.ourdomain.com" - should that be changed to http?
- Mike_G_is_1_134Jul 17, 2014NimbostratusI don't think that you need to put the "https://" part into the if comparison. HTTP::host is just the host value, in your example "application.ourdomain.com". As an alternative, you could also use the HTTP::redirect function instead of responding with the 301. Just a suggestion.
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects