Have you ever been in the situation when you need to inform the users about a downtime of the Citrix Gateway? In most of the cases the administrator will send out an email with information regarding the downtime of the service. But what if you do not have all the email address of the users? Wouldn’t be it fancy to have this information showing up before the user is logging in and starting to work? With the Rewriting feature of the ADC this is a very easy thing to do. Here is an example of a custom message visible under the login button.
Let me show you how its done. If we take a closer look at the login page with the developer options of our browser we need to find the location where we want to put our notification for the user. Use the element picker to determine the location.
1 |
<div id="pluginExplicitAuthBottom" class="pluginAuthBottom"><div id="customExplicitAuthBottom" class="customAuthBottom"></div></div> |
With this information we can create the rewrite action and policy. We are going to insert our custom text after the ‘customAuthBottom’ class.
1 2 |
add rewrite action rw_act_custom_notification insert_after_all "HTTP.RES.BODY(50000).SET_TEXT_MODE(IGNORECASE)" "\"<div id=ADCRewrite style=\'text-align:center;color:white;font-size:20px;\'><div id=Maintenance><br><b>There will be a schedulded maintenance of this site from 7:00am - 9:30am on Saturday 01th of May (GMT+1)</b></div>\"" -search q/text("customAuthBottom\">")/ add rewrite policy rw_pol_custom_notification "HTTP.REQ.URL.CONTAINS(\"/index.html\")" rw_act_custom_notification |
Bind the rewrite policy to the Gateway vServer. It is important to bind the rewrite policy as type RESPONSE.
1 |
bind vpn vserver apps.domain.com -policy rw_pol_custom_notification -priority 100 -gotoPriorityExpression END -type RESPONSE |
Notes
- This rewrite action will only work with the RfWebUI theme.
- When using the X1 Theme you need to create a modified rewrite action.
Great article. Just what I am looking for to alert my end users of upcoming downtimes and other messages I need to get out to my users. However, I am having an issue building the rewrite action in the GUI. I keep getting an error message, “Target must be a simple reference to an unmodified portion of the message”. I am not sure where the issue lies when trying to create the action. I am using firmware NS 13.0 79.64.
Thoughts ? And Thx!
Try to create the action and policy via CLI. Change it afterwards in the Web GUI.
I am trying this very thing, and after creating the rewrite policy I see the policy hits incrementing, but no text is displayed. What more should I try?
As clear as crystal ! Thanks for the very useful and simple instructions.
I had to display a security warning on the logon page, you saved my day !
Great !
Nice article. helped me a lot