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 before ultimately sending the request to www.bbb.com/uri.
I have tried several different attempts at this with no luck. Any help is much appreciated.
4 Replies
Sort By
- hoolio
Cirrostratus
You 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.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. "
- jjpagan_45121
Nimbostratus
Thanks Aaron. I tried this yesterday w/o quotes.... I used curly braces for the content, but I could not get the uri variable to populate. I will try again with quotes in a few. Also, the respond 301 expects a location, so I could not get the content to be presented, unless I did a respond 200. I there anyway to return the 301 AND post the content to the user for 5s? Thanks again. - Peter_72728
Nimbostratus
I just went through this exact exercise last month. The 301 was required by our marketing team because they wanted to transfer page rank (i.e. limit negative impact to search engine ranking). I don't think there's any way to send a 301 AND other content. That kinda goes against the intention of the 301 status code. Even the flexibility of iRules can't change that ;) - jjpagan_45121
Nimbostratus
Yep, I just wanted to ask to make sure I covered all bases. We tried 1 & 2, but neither satisfied all of the requirements. Unfortunately, our Dev team is having trouble coding up a server-side solution. They are still trying.
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