Fortinet white logo
Fortinet white logo

Administration Guide

Replacement messages

Replacement messages

FortiOS has replacement messages that are HTML and text files. These messages can be customized to meet user requirements. The content can be modified, and images can be added.

Modifying replacement messages

The Replacement Messages page has two views. Simple View (the default view) shows the most commonly used replacement messages. Extended View shows the entire list and all replacement message categories.

To modify a replacement message in the GUI:
  1. Go to System > Replacement Messages.

  2. Select a replacement message and click Edit.

    If the message you want to edit is not visible, click Extended View in the upper right-hand corner of the top menu.

  3. Edit the HTML code.

    The message is visible on the left alongside the HTML code on the right. The message view updates in real-time as you edit the content.

    When adding a variable to the code, right-click and select Insert Tag or type %% to view a list of the available variables, or start typing the variable name then press Enter or TAB to auto-complete the variable name.

  4. Click Save.

    Tooltip

    Click Restore Defaults to return to the original message and code base.

To modify a replacement message in the CLI:

For example, to modify the Traffic Quota Limit Exceeded Page message:

config system replacemsg traffic-quota "per-ip-shaper-block"
    set buffer "<html>
  <head>
    <title>
      Traffic Quota Control
    </title>
  </head>
  <body>
    <font size=2>
      <table width=\"100%\">
        <tr>
          <td bgcolor=#3300cc align=\"center\" colspan=2>
            <font color=#ffffff>
              <b>
                Traffic blocked because exceeded session quota
              </b>
            </font>
          </td>
        </tr>
      </table>
      <br>
      <br>
      Traffic blocked because it exceeded the per IP shaper session quota. Please contact the system administrator.
      <br>
      %%QUOTA_INFO%%
      <br>
      <br>
      <hr>
    </font>
  </body>
</html>"
    set header http
    set format html
end

Replacement message images

Images can be added to replacement messages on:

  • Disclaimer pages
  • Login pages
  • Declined disclaimer pages
  • Login failed pages
  • Login challenge pages
  • Keepalive pages
    Note

    The supported image formats are GIF, JPEG, TIFF, and PNG. The maximum file size supported is 24 KB.

Adding images to replacement messages

To add images to replacement messages in the GUI:
  1. Go to System > Replacement Messages.

  2. In the top menu, click Manage Images.

  3. Click Create New.

  4. Enter a name for the image.

  5. Click Upload Image and locate the file.

  6. Click OK.

    The file is now visible in the list.

  7. Return to the replacement message list and edit a message.

  8. Right-click in the message code where you want to add the image, and select Insert Image.

  9. Select the image from the list then press Enter, or double-click on the image to add it to the message.

  10. Click Save.

To add images to replacement messages in the CLI:
  1. Add the image to the FortiGate:

    config system replacemsg-image
        edit <image_name>
            set image-type {gif | jpg | tiff | png}
            set image-base64 <string>
        next
    end
  2. Edit the replacement message, and include %%IMAGE:<image name>%% in the code to add the image.

Replacement messages

Replacement messages

FortiOS has replacement messages that are HTML and text files. These messages can be customized to meet user requirements. The content can be modified, and images can be added.

Modifying replacement messages

The Replacement Messages page has two views. Simple View (the default view) shows the most commonly used replacement messages. Extended View shows the entire list and all replacement message categories.

To modify a replacement message in the GUI:
  1. Go to System > Replacement Messages.

  2. Select a replacement message and click Edit.

    If the message you want to edit is not visible, click Extended View in the upper right-hand corner of the top menu.

  3. Edit the HTML code.

    The message is visible on the left alongside the HTML code on the right. The message view updates in real-time as you edit the content.

    When adding a variable to the code, right-click and select Insert Tag or type %% to view a list of the available variables, or start typing the variable name then press Enter or TAB to auto-complete the variable name.

  4. Click Save.

    Tooltip

    Click Restore Defaults to return to the original message and code base.

To modify a replacement message in the CLI:

For example, to modify the Traffic Quota Limit Exceeded Page message:

config system replacemsg traffic-quota "per-ip-shaper-block"
    set buffer "<html>
  <head>
    <title>
      Traffic Quota Control
    </title>
  </head>
  <body>
    <font size=2>
      <table width=\"100%\">
        <tr>
          <td bgcolor=#3300cc align=\"center\" colspan=2>
            <font color=#ffffff>
              <b>
                Traffic blocked because exceeded session quota
              </b>
            </font>
          </td>
        </tr>
      </table>
      <br>
      <br>
      Traffic blocked because it exceeded the per IP shaper session quota. Please contact the system administrator.
      <br>
      %%QUOTA_INFO%%
      <br>
      <br>
      <hr>
    </font>
  </body>
</html>"
    set header http
    set format html
end

Replacement message images

Images can be added to replacement messages on:

  • Disclaimer pages
  • Login pages
  • Declined disclaimer pages
  • Login failed pages
  • Login challenge pages
  • Keepalive pages
    Note

    The supported image formats are GIF, JPEG, TIFF, and PNG. The maximum file size supported is 24 KB.

Adding images to replacement messages

To add images to replacement messages in the GUI:
  1. Go to System > Replacement Messages.

  2. In the top menu, click Manage Images.

  3. Click Create New.

  4. Enter a name for the image.

  5. Click Upload Image and locate the file.

  6. Click OK.

    The file is now visible in the list.

  7. Return to the replacement message list and edit a message.

  8. Right-click in the message code where you want to add the image, and select Insert Image.

  9. Select the image from the list then press Enter, or double-click on the image to add it to the message.

  10. Click Save.

To add images to replacement messages in the CLI:
  1. Add the image to the FortiGate:

    config system replacemsg-image
        edit <image_name>
            set image-type {gif | jpg | tiff | png}
            set image-base64 <string>
        next
    end
  2. Edit the replacement message, and include %%IMAGE:<image name>%% in the code to add the image.