Exclude Files from CDN

Forge takes all your assets — images, javascript and css files and puts them onto our global CDN, whenever you deploy your site. It’s part of what makes Forge special.

But there are some files that you may prefer not to have the paths dynamically rewritten with each deployment, for example, some JSON data that you want to reference or Robots.txt for telling the search engines how you want them to interact with your site.

Right now if you try to access, for example, https://mysite.getforge.io/mydata.json you’d likely get a 404 error. Because, after deployment, this file would be located at https://cdn.getforge.com/mysite.getforge.io/12345678/mydata.json.

So you would want to exclude some files from the CDN and tell Forge to stop writing their paths each time, or at very least, handle redirects properly for the uploaded asset.

To do this, you can use Forge-Server.

Files
  robots.txt
  mydata.json
  myFolder/mydata.json

Simply add your Forge Server configuration file to the root of your project. This file can be named forgerc.txt, .forgerc, forgerc.json, whichever you prefer.

Be careful to ensure that indentation for filenames is added, under Files.