File Prefix and Root directory
Where to find it
- Open your project.
- Go to Settings.
- Find Root directory, File Prefix, and Use full asset path under General settings.
Root directory and File Prefix need Save changes. Use full asset path is a switch that saves as soon as you change it. Only team admins see Settings.
How files are laid out
With all three settings at their defaults, a publish produces this layout:
index.html
about/index.html
blog/first-post/index.html
files/ stylesheets, scripts, fonts, other files
images/ images
videos/ videos
code-components/ Code Component files, when turned on
sitemap.xml
robots.txt
- Pages keep their Webflow paths.
/aboutbecomesabout/index.html. - Asset links are root-relative. Your pages link to
/files/…and/images/…, so they work on whatever domain serves them. - Image file names lose extra dots.
hero.v2.pngis saved ashero-v2.png. The extension is kept. - Excluded URLs are not downloaded. Assets that match an Excluded URL keep loading from their original host. See Excluded URLs.
Root directory
Root directory puts the whole site inside a folder. With marketing-site, the build contains marketing-site/index.html, marketing-site/files/…, and so on, instead of files at the top level. sitemap.xml and robots.txt move into the folder too.
The folder is also part of every URL:
- Asset links become
/marketing-site/files/…. - Sitemap and canonical URLs become
https://www.example.com/marketing-site/about/. - Your staging site URL gains the folder.
So the site must be served from that folder on your domain. Use Root directory when:
- The site lives in a subfolder of a larger domain.
- Several WCH projects deploy into one bucket or repository and must not overwrite each other.
Enter a folder name with no leading or trailing slash, for example marketing-site. Leave it blank to publish at the top level.
File Prefix
File Prefix adds text in front of the asset folder names. WCH joins it to the folder name exactly as you type it:
assets/:/assets/files/,/assets/images/,/assets/videos/,/assets/code-components/.site-:/site-files/,/site-images/,/site-videos/,/site-code-components/.- Blank:
/files/,/images/,/videos/,/code-components/. This is the default.
Include a trailing slash to make the prefix a folder. Do not start it with a slash.
Pages are not prefixed. about/index.html stays where it is. Use File Prefix when your host routes a path such as /assets/ to a separate bucket or cache rule, or when another system already uses /files/ or /images/ on your domain.
The extra sitemap
When File Prefix is set, WCH writes a second copy of your sitemap with the prefix in front of its name, next to the normal one. With assets/ you get both sitemap.xml and assets/sitemap.xml, with the same content. The normal sitemap.xml is always published. See Sitemap settings.
Use full asset path
Use full asset path controls how files are arranged inside /files/ and /videos/.
- Off: every file sits at the top of the folder.
https://cdn.example.com/lib/v2/slider.jsbecomes/files/slider.js. - On: each file keeps the folder path of its original URL. The same script becomes
/files/lib/v2/slider.js.
Turn it on when two files from different places share a name. With it off, the second file overwrites the first. Webflow's main site stylesheets always stay at the top of /files/. Images always stay flat in /images/.
Until you change this switch on a project, it follows the team's Use full asset path setting. Once you change it here, the project keeps its own value. See Team settings and templates.
Changing these settings on a live site
Changing any of these settings leaves the old files at your destination. WCH does not delete files at destinations. After the change, pages link to the new paths, but the files at the old paths stay until you remove them. Clear them at your destination so visitors cannot reach an outdated copy. For S3, see Removing Dead Files During an S3 Publish.
These settings change the path of every page or asset, so every page must be republished:
- Change the setting and click Save changes if it needs it.
- If Cache is on, go to Extensions, then Cache, and click Clear all cache. Otherwise unchanged pages are skipped and keep their old links. See Cache.
- Click Publish all pages on the Dashboard.
Testing your changes
- Make the change and republish as above.
- Open your staging site and check a page with images, a video, and custom scripts.
- Open your browser's developer tools and confirm no stylesheet, script, or image fails to load.
- Open
/sitemap.xmlon staging, inside your root directory if you set one, and confirm the URLs match where the site will live. - Once staging looks right, promote to production. Then remove the files at the old paths at your destination.