Forum Discussion
jjpagan_45121
Nimbostratus
Jul 14, 2011301 redirect to new url with splash page and retain uri
I have a request to route all traffic destined for www.aaa.com/uri to www.bbb.com/uri using a 301 redirect. The twist is I must present a "you are being transferred to new site" message for 5 seconds...
hoolio
Cirrostratus
Jul 14, 2011You can use Javascript or a meta-refresh to display a message like that. The trick is figuring out what HTML to send back to the client. Once you figure that out, you can use HTTP::respond $status_code content "..." to do it.
Here's one example from a random site: http://www.pageresource.com/html/metref.htm
Note that if you want to include an iRule command or variable to set the host or URI dynamically, you'll need to wrap the HTML in double quotes and escape any quotes in the HTML with backslashes. Here's an untested example:
HTTP::respond 200 content "
Page has moved
This page has moved. If your browser does not automatically redirect you in a few seconds, click to go to the new page.
"
Aaron
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