404 Page in Angular is not routable with localization (** can't be resolved)

Discussão em 'Angular' iniciado por GameOfNicoYT, Dezembro 10, 2024.

  1. GameOfNicoYT

    GameOfNicoYT Guest

    I have an application built for (currently) two languages. German and English. I am also trying to Route some pages like about, home, login, etc... But I am facing one issue I just can't resolve. If no language is given on visit and a non acceptable route is entered in the url bar (example.com/unknown) I get the Netlify not found window. Even with my routes set up.

    It only accepts example.com/en|de/unknown and will resolve the 404 route.

    | ... standing for "or" in this case

    Routes:

    export const routes: Routes = [
    { path: '', component: HomeComponent },
    { path: 'about', component: AboutEduguardComponent },
    { path: 'download', component: DownloadComponent },
    { path: 'license', component: GetLicenceComponent },
    { path: 'login', component: LoginComponent },
    { path: 'contact', component: ContactComponent },
    { path: '404', component: NotFoundComponent },

    { path: '**', redirectTo: '404' },
    ];


    I have tried many things, that ended up with the same result. Like removeing i18n and redoing everything configurating a baseHref with no change, etc...

    Continue reading...

Compartilhe esta Página