Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@mdebbar
Copy link
Contributor

@mdebbar mdebbar commented Jun 6, 2023

To make the HashUrlStrategy a bit cleaner (at least for the home page), let's get rid of the notorious /#/ when the app is in the home page.

Non-home pages continue to have a hash in them. After this PR, here are some example URL changes:

  • http://domain.com/#/ => http://domain.com/
  • http://domain.com/#/page1 => (remains the same)

This change is backwards compatible, i.e. if you write http://domain.com/#/ in the address bar, the app will load and open the home page correctly; and flutter will automatically change the URL to http://domain.com/.

Fixes flutter/flutter#127608

@mdebbar mdebbar requested a review from kevmoo June 6, 2023 19:38
@flutter-dashboard flutter-dashboard bot added the platform-web Code specifically for the web engine label Jun 6, 2023
Copy link
Contributor

@kevmoo kevmoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mdebbar mdebbar added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 6, 2023
@auto-submit auto-submit bot merged commit 6f9df0f into flutter:main Jun 6, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 6, 2023
@mdebbar mdebbar deleted the remove_hash branch June 22, 2023 21:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-web Code specifically for the web engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[web] Remove the trailing /#/ on home pages

2 participants