v1 Implementation Notes
Path Remapping implementation notes
4 Workers work together in this solution;
cmsitem-redirect
handles all redirects from the source path to the destination path.cmsitem-redirect-page
handles all rewrites from source path to the destination path, as well as canonical URL changes.cmsitem-redirect-sitemap
handles the path remapping in the sitemap.xmldebug-rewrite
handles all other pages, this is used for indirectly proxied sites, often in a test setup.
All of these draw from a central configuration file stored in the CONFIG
KV store;
The key is your base domain, followed by :cmsitem-redirect
;
e.g. mydomain.com:cmsitem-redirect
The value is a JSON config chunk that all of the cmsitem-redirect workers use, e.g.;
When modifying your config, it's essential to make sure your JSON is valid. We recommend you protect yourself from mistakes with these two practices;
Always validate your JSON, before setting a new config.
Always save your previous JSON config somewhere safe before changing it.
Worker routes;
Route ( example ) | Worker | Notes |
---|---|---|
| cmsitem-redirect | Define the routes you want to be redirected here. |
| cmsitem-redirect-page | Define the routes wher |
| cmsitem-redirect-sitemap | Define the route to your sitemap.xml. |
| debug-rewrite | Only needed for indirect proxy setups. |
Note all config work is managed by the Config class within the cmsitem-redirect worker
Future
Add dynamic map types
Support hiding of dynamic pages
Map Types
static, stored in KV as JSON
dynamic, generated on site, on a hidden page
Last updated