Forum Discussion
Dipx
Nimbostratus
Aug 01, 2021Redirect domains to another domain with exclusion in URI
Hello, I'm new to f5 technologies, I would need help to create an iRule for the below requirements. Client requests to web1.com should redirect to web2.com ( Web2.com is on different environ...
Aug 01, 2021
Hi Dipx,
Create a datagruop and add the excluded URIs.
Change the datagroup name in the below iRule.
when HTTP_REQUEST {
if { [HTTP::host] equals "web1.com" && not [class_match [string tolower [HTTP::uri]] starts_with datagroupname] } {
HTTP::redirect https://web2.com[HTTP::uri]
}
}
You can use equals or start_with as per your need.
Datagroup strings must start with /
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