diff --git a/src/Umbraco.Web.UI.Client/src/packages/content/content/workspace/views/edit/content-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/content/content/workspace/views/edit/content-editor.element.ts
index 693808923e79..8432f1c8cfde 100644
--- a/src/Umbraco.Web.UI.Client/src/packages/content/content/workspace/views/edit/content-editor.element.ts
+++ b/src/Umbraco.Web.UI.Client/src/packages/content/content/workspace/views/edit/content-editor.element.ts
@@ -85,7 +85,7 @@ export class UmbContentWorkspaceViewEditElement extends UmbLitElement implements
if (this._hasRootGroups) {
routes.push({
- path: `root`,
+ path: 'root',
component: () => import('./content-editor-tab.element.js'),
setup: (component) => {
(component as UmbContentWorkspaceViewEditTabElement).containerId = null;
@@ -108,17 +108,17 @@ export class UmbContentWorkspaceViewEditElement extends UmbLitElement implements
if (routes.length !== 0) {
routes.push({
+ ...routes[0],
+ unique: routes[0].path,
path: '',
- pathMatch: 'full',
- redirectTo: routes[0].path,
- });
-
- routes.push({
- path: `**`,
- component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
});
}
+ routes.push({
+ path: `**`,
+ component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
+ });
+
this._routes = routes;
}
@@ -132,18 +132,20 @@ export class UmbContentWorkspaceViewEditElement extends UmbLitElement implements
? html`
`
: ''}
${repeat(
this._tabs,
(tab) => tab.name,
- (tab) => {
+ (tab, index) => {
const path = this._routerPath + '/tab/' + encodeFolderName(tab.name || '');
return html``;
},
)}
diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-editor/workspace-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-editor/workspace-editor.element.ts
index 6c16b3aac4e8..f55bcd8c89ea 100644
--- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-editor/workspace-editor.element.ts
+++ b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-editor/workspace-editor.element.ts
@@ -75,13 +75,15 @@ export class UmbWorkspaceEditorElement extends UmbLitElement {
// Duplicate first workspace and use it for the empty path scenario. [NL]
newRoutes.push({ ...newRoutes[0], unique: newRoutes[0].path, path: '' });
-
- newRoutes.push({
- path: `**`,
- component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
- });
}
+ // Add a catch-all route for not found
+ // This will be the last route, so it will only match if no other routes match or if no workspace views are defined.
+ newRoutes.push({
+ path: `**`,
+ component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
+ });
+
this._routes = newRoutes;
}