Resource Resolution Order
The order in which specific types of behavior or views load, from 301 redirects to 404s.
When a request is served by WebEngine, it reads the url path and attempts to match the url path to a content item resources. URL are checked against resource in a specific order, and will resolve the resource first if a match is found. If two resources share a URL path, then the one that loads first will resolve and the other is ignored.
Resource load order:
- Proxy (if configured). If url doesn't exist, it skips.
?toJSON
urls ignore proxy - Media Proxy (if configured) for
/-/media/
urls - Static files generated by Zesty.io:
site.css
andsite.js
- Instant JSON API e.g.
/-/instant/7-zyx-zyxzyc.json
- GQL API e.g.
/-/gql/*
- Static files generated by Zesty.io:
sitemap.xml
,feed.xml
,robots.txt
- Legacy JSON endpoints e.g.
/-/custom/
- Well Known Files e.g.
/.well-known/*
- Custom endpoints e.g.
/custom/endpoints.json
- Legacy HTML endpoints e.g.
/ajax/
- Content Models Views if a content item's meta path matches the request page e.g.
/about/team/
- Wild Card Views e.g.
/store/*/cool-shirt/
- 301 redirects
- 404 Pages e.g. when no resources match the url pattern
Base Directory Setting
Overview
Zesty.io will default all automated assets files to the root /
directory unless the base directory setting has been added and set.
There is a setting on the instance with category:general
key:base_directory
with a directory set as its value e.g. /blog/
Base Directory and Zesty.io Auto-created Files
Once the Base Directory settings has a value the Zesty.io auto-created files listed below will be immediately affected.
- site.js
- site.css
- sitemap.xml
- robots.txt
- feed.xml
- Instant JSON API
- GQL API
Using the Base Directory setting with non-automated files
Other files created in the code editor such as custom endpoints must be manually named to follow the path of your choice. If you want content items to follow the same path as the Base Directory setting value, then a content model must exist with that path. For example, if you're using Zesty.io WebEngine only for your website's /blog/
subdirectory then you need to setup a content item as a placeholder with /blog/
as its URL and create the Base Directory setting (as shown below) with the value /blog/
.
Adding the Base Directory Setting
The Base Directory setting can be added via API with the following JSON body:
{
"category": "general",
"keyFriendly": "Base Directory",
"key": "base_directory",
"value": "",
"admin": false,
"parselyAccess": false,
"dataType": "text",
"options": "",
"tips": ""
}
If you know what value you want the base directory set to go ahead and add it to the JSON body under value
.
Reserved Paths
Some path parts are reserved for security reasons. Any content item url path that includes these words will 404.
- vendor
- composer
- package
- package-lock
- gulpfile
- README
Updated 11 days ago