05-Jun-2020 06:48
Is there a way for a BIG-IP to display a message such as “This site has moved, please note the new URL." and then redirect to the new page in 10 seconds.
07-Jun-2020
03:43
- last edited on
04-Jun-2023
21:26
by
JimmyPackets
Not tested so far. Can you write iRule something like this. Try and let us know if any question
when HTTP_REQUEST {
set expires "10000"
HTTP::respond 200 content "Sorry, this page is not currently available."; Max-Age=$expires"
HTTP::redirect "https://www.xyz.com"
}
10-Oct-2020 05:08
Hi Samir,
I tried with this IRule but it
not working for me, I can see the message but after that redirection is not
working.
One of our URL is getting retired and getting replaced with new one. So when any user trying to access old url, it should display a message for 5 seconds to users that its retired and redirect to new URL.
Can you please help on this.
22-Dec-2020 06:41
What was the example iRule that worked for this discussion?
23-Dec-2020
04:56
- last edited on
04-Jun-2023
21:07
by
JimmyPackets
Yes its doable, I've done some recently too. But I used the Ifile method, but the concept is same,
Create an Ifile with below content,
<html>
<head>
<meta http-equiv="Refresh" content="10; url=https://www.newwebsite.com" />
</head>
<body><p><center>This URL is being retired. You are being redirected to new site -<a href="https://www.newwebsite.com">New Website name</a>.</center></p>
</body>
</html>
Then load that ifile in Irule,
when HTTP_REQUEST {
if { [HTTP::uri] equals "/index.html"}{
HTTP::respond 200 content [ifile get "new-website.html"] "Content-Type" "text/html"
}
}
}