GoRouter.dev

Current field guide · 2026

Make a deep link survive reload

Clean paths require both Flutter URL configuration and a host that serves the app entry point for valid application routes.

Edition published 21 Oct 2026go_router 18.1.1 reference
On this page

Hash and path are hosting decisions too

A hash URL keeps the client-side destination after #. A path URL exposes the destination in the normal path. The cleaner appearance of path URLs comes with a server requirement: requesting a nested location must still return the Flutter application.

Set the Flutter strategy

Use the supported flutter_web_plugins URL strategy helper during app initialization. Check the framework documentation for the SDK you ship, and keep the web base path consistent with where the app is deployed.

Configure a scoped fallback

For a Flutter single-page app, rewrite valid app paths to index.html. Serve actual assets normally and avoid rewriting missing JavaScript or CSS into HTML. If the app shares a host with APIs or a documentation site, scope the fallback to the application mount point.

Verify over HTTP

Paste a nested URL into a fresh browser, refresh, and confirm the returned document and asset content types. This documentation site is statically generated and intentionally returns a real 404 for an unknown documentation page; it does not use an application-wide index fallback.

dart / example
import 'package:flutter_web_plugins/url_strategy.dart';

void main() {
  usePathUrlStrategy();
  runApp(const App());
}

// Configure your web host for your app's mount point.
Earlier edition: read the complete original guide. Its older APIs are kept in historical context.

Sources & version context

GoRouter.dev documentation edition. Examples illustrate the APIs described in the linked primary documentation. Adapt application-owned widgets and services to your project. They are not an executed Flutter session in this browser.

Find your next route