Customizing WebDirect's Default Webpages

Customizing WebDirect's Default Webpages

You can redirect users to any webpage you choose when exiting a WebDirect solution, depending on what you want them to do next. There are two techniques for setting on-exit target-page URLs:

1. Scripted Redirect Triggered OnLastWindowClose

Create this script and set it to run in File Options > Script Triggers > OnLastWindowClose:

If [ PatternCount ( Get ( ApplicationVersion ) ; "web" ) ]
      Open URL [no dialog; "full URL to your target page here"]
End If

This will redirect users who log out via WebDirect to your page, but it can leave a background browser window or tab open with FileMaker's default WebDirect page still visible in the background.

The second technique, below, actually changes the default WebDirect page.


2. Modify the HTML in WebDirect's library files

To do that, first, shut down FMServer processes.

Then locate the file "iwp_home.html" in the FileMaker Server directory:

FileMaker Server\Web Publishing\publishing–engine\jwpc–tomcat\fmi\ VAADIN\themes\default\layouts\iwp_home.html

(Mac users, begin in the Mac's Library folder...)

When you have located the "iwp_home.html" file, copy it (don't try moving it) from its original location to your desktop, and then make a second copy of it to save unedited in case you ever want to restore the default behavior.

Edit one copy of the file, either replacing all of the file's text content with:

<body>
  <script type="text/javascript">
    top.location.href = "http://{your URL here}";
  </script>
</body>

or use a Refresh/Redirect header tag, as in the following code for a full HTML5 redirect-page:

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="refresh" content="0; 
 URL=http://{your URL here}">
<meta charset="UTF-8">
</head>
<body>&nbsp;</body>
</html>

Save the file after entering the full URL to the webpage you will use as a custom WebDirect launcher, being careful to remove the brackets inside the quoted URL.

Next copy the modified file back to the original location in the Server Library directories, authenticating as required to make directory changes, and overwriting the original file. (Don't save both the old and new copies in the same directory or it won't work.)

Then restart the server processes, and test your page via WebDirect with the server running. When it's all done correctly, WebDirect will use the custom webpage at your URL as its default when closing WebDirect.

It is up to you to program custom WebDirect pages on your website and/or in you server's library files.


Instructions for creating custom WebDirect links which open specific databases are provided on a separate page.