diff --git a/packages/volto/src/routes.js b/packages/volto/src/routes.js index a1fb227a57..9e04390c8b 100644 --- a/packages/volto/src/routes.js +++ b/packages/volto/src/routes.js @@ -124,7 +124,7 @@ export function getExternalRoutes() { ); } -export const defaultRoutes = [ +const baseRoutes = [ // redirect to external links if path is in blacklist ...getExternalRoutes(), ...((config.settings?.isMultilingual && multilingualRoutes) || []), @@ -313,6 +313,9 @@ export const defaultRoutes = [ component: PersonalInformation, exact: true, }, +]; + +const fallbackRoutes = [ { path: '/**', component: View, @@ -323,6 +326,20 @@ export const defaultRoutes = [ }, ]; +let prefixRoutes = []; +if (config.settings.prefixPath) { + prefixRoutes = baseRoutes.map((route) => ({ + ...route, + path: `${config.settings.prefixPath}${route['path']}`, + })); +} + +export const defaultRoutes = [ + ...baseRoutes, + ...prefixRoutes, + ...fallbackRoutes, +]; + /** * Routes array. * @array