Forum Discussion
HTTP::host and if match, redirect by using HTTP::redirect.
One of your best bets will be to check out a few different pages including the wiki article for HTTP::uri to understand how to modify the URI in an iRule. Also the iRules 101 articles that are a good introduction to iRules in general and how to write them.
Then, you can look at this iRule and better understand exactly what's going on, or how to modify it in the future to suit any changing needs you may have.
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "example.com" } {
HTTP::redirect "http://www.example.com[HTTP::uri]"
}
}
That being said, another option would be to use a Local Traffic Policy to do the redirect. Here's a devcentral page talking about setting one up.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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