【发布时间】:2021-11-30 19:03:27
【问题描述】:
我需要带有基本 url 的 web 应用程序
https://example.com/mojjo-test/index.html#/
我更新了我在颤振网站中记录的基本网址: https://flutter.dev/docs/development/ui/navigation/url-strategies
<base href="/mojjo-test/">
在 index.html 中
根据颤振文档哈希已经启用
观察:
1.Flutter web app加载,加载时显示url,
http://example.com/mojjo-test/index.html
2.几秒钟后它重定向到
http://example.com/mojjo-test/#/
- 现在,如果我们进行刷新,浏览器将尝试加载
http://example.com/mojjo-test/#/并显示访问被拒绝
我假设它应该重定向到http://example.com/mojjo-test/index.html#/,而不是重定向到http://example.com/mojjo-test/#/
请提供有关如何实现它的建议。我想保持初始路径为https://example.com/mojjo-test/index.html#/(带有index.html)
【问题讨论】:
标签: flutter flutter-web flutter-routes