We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Http Service模式下,前端路由刷新后页面会找不到,例如用react和angular这种带有前端路由的SPA页面,如果在带有路由的页面上进行强刷,就是找不到页面。
他们一般靠服务器端的rewrite功能解决这个问题,是否可以做类似的功能像是加一个.htaccess文件,里面写上rewrite的规则
No response
The text was updated successfully, but these errors were encountered:
感谢您的反馈!
你可以使用下面代码替换逻辑:
.ConfigurePlugins(a => { a.UseHttpStaticPage(option => { var filesPool = option.FilesPool; option.SetNavigateAction((request) => { var relativeURL = request.RelativeURL; var url = relativeURL; if (filesPool.ContainsEntry(url)) { return url; } if (relativeURL.EndsWith("/")) { url = relativeURL + "index.html"; if (filesPool.ContainsEntry(url)) { return url; } } else if (relativeURL.EndsWith("index")) { url = relativeURL + ".html"; if (filesPool.ContainsEntry(url)) { return url; } } else { url = relativeURL + "/index.html"; if (filesPool.ContainsEntry(url)) { return url; } } return "/index.html"; }); }) .AddFolder("www"); // 默认插件应该最后添加,其作用是 // 1、为找不到的路由返回404 // 2、处理header为Option的跨域请求。 a.UseDefaultHttpServicePlugin(); }));
Sorry, something went wrong.
RRQM
No branches or pull requests
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
Http Service模式下,前端路由刷新后页面会找不到,例如用react和angular这种带有前端路由的SPA页面,如果在带有路由的页面上进行强刷,就是找不到页面。
Describe the solution you'd like
他们一般靠服务器端的rewrite功能解决这个问题,是否可以做类似的功能像是加一个.htaccess文件,里面写上rewrite的规则
Additional context
No response
The text was updated successfully, but these errors were encountered: