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...
Joe_Pipitone
Nimbostratus
Mar 17, 2010This triggers an error - forgive me, I'm not too familiar with syntax:
01070151:3: Rule [cplanning-rewrite] error:
line 8: [undefined procedure: elseif] [elseif { ([HTTP::host] eq "ourdomain.com") } {
switch -glob [HTTP::host] {
"/" { HTTP::redirect "http://anotherdomain.com" }
default { HTTP::redirect "http://anotherdomain.com[HTTP::uri]" }
}
} ]
The iRule:
when HTTP_REQUEST {
if { ([HTTP::host] eq "www.ourdomain.com") } {
switch -glob [HTTP::host] {
"/" { HTTP::redirect "http://anotherdomain.com" }
default { HTTP::redirect "http://anotherdomain.com[HTTP::uri]" }
}
}
elseif { ([HTTP::host] eq "ourdomain.com") } {
switch -glob [HTTP::host] {
"/" { HTTP::redirect "http://anotherdomain.com" }
default { HTTP::redirect "http://anotherdomain.com[HTTP::uri]" }
}
}
}
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
