Forum Discussion
iaine
Jan 28, 2021Nacreous
Hi
Try something like this
when RULE_INIT {
set static::refresh_time 5
set static::notification_page {
<html>
<head>
<meta http-equiv="refresh" content="$static::refresh_time;url=$original_uri" />
</head>
<body>
<br>
System Notification<br>
<br>
Bookmark the new home: http://www.abc.com/home.<br>
<br>
This message will close in $static::refresh_time seconds to continue.<br>
</body>
</html>
}
}
when HTTP_REQUEST {
if { ( [HTTP::uri] eq "/def.html") and (not [HTTP::cookie exists NotificationDone]) } {
set original_uri [HTTP::uri]
HTTP::respond 200 content [subst $static::notification_page] "Mime-Type" "text/html" "Set-Cookie" "NotificationDone=1; path=/; domain=[HTTP::host]"
} elseif { ( [HTTP::uri] eq "/xyz.html") and (not [HTTP::cookie exists NotificationDone2]) } {
set original_uri [HTTP::uri]
HTTP::respond 200 content [subst $static::notification_page] Mime-Type "text/html" "Set-Cookie" "NotificationDone2=1; path=/; domain=[HTTP::host]"
}
}