Add a GDPR Footer to the NetScaler Login Page

One of the latest requests I got was to add a GDPR Footer to our NetScaler Login Pages. The Requirement was to display a Link to our Imprint and to our Privacy Policy on the bottom of the Login Page to comply(?) with the new GDRP Requirements.

This can also be used to display other Links or Information. You could for example put a Link to your Helpdesk Portal or to a Self Service Password Reset Site on there.


We start by creating a new Rewrite Action. I decided to name mine rw_act_then_insert_gdpr_footer

Next Step is to configure the needed Expression and Settings for the Rewrite Action. Make sure to edit the HTML Code incuded in the Expression with your needed URLs and Descriptions to your Imprint and/or Privacy Policy (in case of our example).

NetScaler Rewrite Action in the NetScaler GUI

  • Name: rw_act_then_insert_gdpr_footer
  • Expression to choose Target Location: HTTP.RES.BODY(120000).SET_TEXT_MODE(IGNORECASE)
  • Expression: "var login_footer=$(\"<br><div style='text-align:center;color:white;font-size:15px;'><a target='_blank' style='color:white;text-decoration:underline' href=''>Imprint</a>"+"  |  "+"<a target='_blank' style='color:white;text-decoration:underline' href=''>Privacy Policy</a><br></div>\").appendTo(logonbox_container);"
  • Pattern: box_view.prepare_view()

When done this should look something like this:

Completed Rewrite Action in the NetScaler GUI

Now it's time to configure the Rewrite Policy. According to my Naming Scheme I've choosen to go with rw_pol_then_insert_gdpr_footer

  • Name: rw_pol_then_insert_gdpr_footer
  • Action: rw_act_then_insert_gdpr_footer
  • Expression: HTTP.REQ.URL.CONTAINS("gateway_login_view.js")

The final Rewrite Policy should look like this:

Last Step is to bind the newly created Footer to the NetScaler Gateway vServer where we want to display the Links. In my case I have a lot of rewrite Policies so make sure you set your GoTo Expression to Next. This is how my Rewrite Policy Bindings on the NetScaler Gateway vServer looks like.

And this is the Result when done correctly


This Rewrite Policy only works with the Classic, Greenbubble and X1 Theme. The newer RfWebUI Theme is not supported.


If you don't want to use the GUI you can also use the following NetScaler CLI Commands to create the required Rewrite Policy and Rewrite Action.

add rewrite action rw_act_then_insert_gdpr_footer insert_before_all "HTTP.RES.BODY(120000).SET_TEXT_MODE(IGNORECASE)" q{"var login_footer=$(\"<br><div style='text-align:center;color:white;font-size:15px;'><a target='_blank' style='color:white;text-decoration:underline' href=''>Imprint</a>"+"  |  "+"<a target='_blank' style='color:white;text-decoration:underline' href=''>Privacy Policy</a><br></div>\").appendTo(logonbox_container);"} -pattern "box_view.prepare_view();"

add rewrite policy rw_pol_then_insert_gdpr_footer "HTTP.REQ.URL.CONTAINS(\"gateway_login_view.js\")" rw_act_then_insert_gdpr_footer