Forum Discussion
rmangram07_7795
Nimbostratus
Jul 26, 2013Redirecting Old Site to New Site Same Directory
I am new to irules and this seems straight forward but I cannot find the answer to this:
I have a site www.oldsite.com redirected to www.landingpage.com, and that works fine.
...
nitass
Employee
Aug 08, 2013Still no go for http://www.oldsite.com/it.. goes to new site still.. Here is what I have...
oops i just notice it is www.oldsite.com (not oldsite.com). so, can you try this?
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] ends_with "oldsite.com" } {
set uri [string tolower [HTTP::uri]]
if { $uri equals "/" } {
HTTP::respond 302 noserver Location "https://landingpage.com"
} elseif { $uri starts_with "/it/" } {
if { [TCP::local_port] == 80 } {
HTTP::respond 302 noserver Location "https://[HTTP::host][HTTP::uri]"
}
} else {
HTTP::respond 302 noserver Location "https://newsite.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