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
Jul 26, 2013what is the existing irule? can you try something like this?
e.g.
[root@ve11a:Active:Changes Pending] config tmsh list ltm virtual bar
ltm virtual bar {
destination 172.28.20.111:80
ip-protocol tcp
mask 255.255.255.255
pool foo
profiles {
http { }
tcp { }
}
rules {
myrule
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vlans-disabled
}
[root@ve11a:Active:Changes Pending] config tmsh list ltm rule myrule
ltm rule myrule {
when HTTP_REQUEST {
if { [HTTP::host] eq "www.oldsite.com" } {
HTTP::respond 302 noserver Location "http://www.newsite.com[HTTP::uri]"
}
}
}
[root@ve11a:Active:Changes Pending] config curl -I http://172.28.20.111/something -H "Host: www.oldsite.com"
HTTP/1.0 302 Found
Location: http://www.newsite.com/something
Connection: Keep-Alive
Content-Length: 0
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