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...
hoolio
Cirrostratus
Mar 17, 2010Hi Joe,
I think this consolidated version should do the same:
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"ourdomain.com" -
"www.ourdomain.com" {
"http://anotherdomain.com[HTTP::uri]"
}
}
}
http://www.tcl.tk/man/tcl8.4/TclCmd/switch.htm
If a body is specified as - it means that the body for the next pattern should also be used as the body for this pattern (if the next pattern also has a body of - then the body after that is used, and so on). This feature makes it possible to share a single body among several patterns.
Aaron
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
