Forum Discussion
Joe_Pipitone
Nimbostratus
Mar 16, 2010Rewriting - syntax
I want to be able to catch http://www.domainname.com/anyurl/anypage.aspx or http://domainname.com/anyurl/anypage.aspx- both with and without the www and rewrite as needed. I am currently using an iRu...
Hamish
Cirrocumulus
Mar 17, 2010For performance reasons I'd suggest an else in there... However you may also want to investigate using a switch statement, or using a class (DataGroup) and the findclass/class commands to lookup the recieved host and return the redirection host (The findclass should scale better, and mean you don't have to re-write your iRule whenever you add a new host).
e.g. (Without checking for syntax, this is for v10)
when HTTP_REQUEST {
set redirecthost [class search -value "theclass" equals [HTTP::host]]
if { $redirecthost ne "" } {
HTTP::redirect $redirecthost
}
}
You can add the embelishments...
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
