Forum Discussion
Mike_Wethington
Nimbostratus
Aug 27, 2009301 Redirect
We are moving our datacenter from one location "A" to another location "B". I need to do a 301 redirect from "A" to "B" for all traffic. The URL is staying the same the only thing changing is the IP address. I have tried the irule below but I get a page cannot be found error instead of the page. I used wire shark to trap the packets and the server responds with the permanetly moved 301. Both site "A" and "B" are behing big-ip's Can anyone help me with this?
when HTTP_REQUEST {
HTTP::respond 301 "192.168.1.1" "http://[HTTP::host][HTTP::uri]"
}
- hoolio
Cirrostratus
If the only thing that is changing is the IP address the hostname resolves to, you'll need to change the A record for the fully qualified domain name. You could try to redirect clients that still have the old IP address to the new IP address, but if the app then references the hostname, they'll still make requests to the old IP address they have cached.when HTTP_REQUEST { Redirect to new server IP with same URI HTTP::redirect "http://192.168.1.1[HTTP::uri]" }
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