Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 683 Bytes

redirecting-routes.md

File metadata and controls

33 lines (26 loc) · 683 Bytes

Redirecting routes

You can set up redirects in your route configuration to automatically navigate users from one route to another.

Basic Redirect

config.map([
  { route: '', redirect: 'home' },
  { route: 'home', name: 'home', moduleId: PLATFORM.moduleName('home/index') }
]);

This will redirect the root URL to the 'home' route.

Redirect in Route Config

You can also use the redirect property in more complex route configurations:

config.map([
  { 
    route: 'legacy-route', 
    name: 'legacy', 
    redirect: 'new-route'
  },
  {
    route: 'new-route',
    name: 'new',
    moduleId: PLATFORM.moduleName('new/index')
  }
]);