• Who: Anyone who created a web app and wants to place the web app resources files (.js, .css, assets/, etc.) in the FMS conf folder to host on the FM server.
  • What: Workaround for FMS URL Rewrite causing hosted web files like .js and .css to be missing from all other web sites hosted on the server.
  • With: FileMaker Server 19.4+
  • Why: Recent FileMaker Server versions add an aggressive URL Rewrite to the web server which redirects common web app resource files to the localhost address:  This causes all other web apps on the server to redirect these resources as well, making these files unavailable to the other sites fully breaking all other sites using these kinds of files.

Overview: Recent FileMaker Server Installs are Breaking Our Web Apps

I recently had to replace an older FileMaker Server and decided to make the move to the most recent version.  On the previous server, I had several custom web apps that were being hosted in the FileMaker HTTPserver/conf folder where it was always very easy to simple drop in some web files (html, css, and js) files and see them come alive in the browser.  I used FileMaker as the backend via the fantastic Data API, and everything was beautiful.., but this time I was getting a very strange error.  Checking my browser dev tools, I could see that it was saying that most of my .js and .css files were missing from the directory.  I double and triple checked, and everything was there alongside other files like html and jpg files (which had no problem being accessed by the browser).  After many hours of rabbit holes that didn’t address my issue, I discovered that it was actually the FileMaker Server install that added several URL rewrites to the web server (in my case IIS) in order to make the new admin-console direct address work (this is where you can now directly access the web console without using the 16001 port like this:

Unfortunately, these redirects are hijacking other .js and .css files and causing my custom web apps to fail.  This is a MAJOR bug in the way that FileMaker Server configures the web server and essentially prevents users from using the server to host their own custom web apps.  The saddest part is that it’s been around 2 years since version 19.4 where this seems to first be an issue, and the community isn’t complaining about it enough to make Claris notice (…which must mean that we aren’t developing many custom web apps for FileMaker overall, and that is kind of a bummer).

The Fix

Fortunately, in IIS (Windows Server’s web server), there is a quick and easy way to fix this! I’m assuming there is a similar function/feature in other web servers, but this guide is specifically for IIS in a Windows Server.

Quick background: after a FileMaker Server install, the default directory for hosting web sites changes from intepub to the HTTPserver/conf folder (inside of the FileMaker Server install directory).  It’s always been easy to create a new folder under the conf folder for each new site I added, so essentially I could have different “apps” behind the same domain name: like dashboard.mysite.com, database.mysite.com, crm.mysite.com etc.  Each of those subdomains really just reflects folders inside the conf folder like:

Since IIS creates a secondary web.config file inside each of these directories, we can turn off the redirects in each individual directory!

  • Open IIS: in the Windows Server search box, look for IIS:

  • Find the FMWebSite: in IIS, open the arrows on the left side of the screen to reveal your server’s Sites section and the underlying default site: “FMWebSite”:

  • Locate the URL Rewrite icon:
    • The URL Rewrite above is specific to the “root” folder of the web server.  The physical equivalent is our conf folder (at HTTPserver/conf in the FileMaker Server install directory).
    • Here are the rewrite rules in the root folder causing the issue:

  • Locate Subdirectory URL Rewrite: Since we are placing physical folders inside our conf folder to represent different subdomains on our web site, we can click on each individual folder below the default site, double click the URL Rewrite icon, and disable these rewrite rules on each individual directory!  Notice the same rewrite rules below are grayed out while the “Dashboard” directory is selected:

  • Disable the rule: to disable the rule in any directory, simply click on the rule and press the Disable button at the right:

The Technicals: what is technically happening here is that the FileMaker Server install creates a set of rules in the default web publishing folder which exist in a file called: web.config.  However, when we open the URL Rewrite from the subdomain folder, a secondary web.config file is placed inside our subdomain folder with instructions to “remove” the rules we disabled.  This web.config takes priority over the web.config in the root web publishing folder the same way a CSS style sheet “cascades” and takes priority of styles the “closer” it is to the final HTML file(s).

Wrapup: once you are done disabling the rules for your subdomains, your web apps should work again.  The good news is that this method doesn’t interfere with FileMaker Server’s new admin console access at the localhost: (without using port 16001).  Hope that helps!