Ionic 4 - PWA and navigation


I’d like to know why when I go here in my PWA: the url becomes

but if i try to go directly to by typing it in the browser, it tells me it can’t find that page?

My route code is this:

import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';

const routes: Routes = [
  { path: '', redirectTo: '/home', pathMatch: 'full' },
  { path: 'home', loadChildren: './home/home.module#HomePageModule' },

  imports: [
    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
  exports: [RouterModule]
export class AppRoutingModule { }


You have to rewrite you server urls to serve all (or just some) request to index.html

You server have no idea /home is related to the Ionic app

1 Like

How can that be done?

Okay I’ve found out that if you create a home folder in the www and paste the index there it works. Isn’t there some better way?

Depends on your server. Here is instructions for Firebase hosting: