Open alansemenov opened 5 years ago
NB! When using vhosts, this is not a problem, so this only relates to cases where the url is used directly. Test out carefully that this does not affect webapps deployed through vhosts.
NB! Also try out how this works for vhosts with subpath i.e. myapp.com/app etc.
The purpose is simply that we don't want webapp developers to build custom code to handle development specific problems.
Also, would be nice with some considerations on how this might affect admin tools as well. i.e. what if content studio was a PWA.
Not a fan of this idea. This seems to be a case very specific to PWA. Not sure that we should force this behaviour on all webapps. Putting it to backlog for discussion
Thought this was already done?
libRouter.get('/?', req => {
if (!(req.rawPath || '').endsWith('/')) {
return {
redirect: req.path + '/'
}
}
return {
body: ...
So, I don't see a great demand for this anymore.
I think this is already implemented for webapp root? But really nice to control this via app code anyway.
Are we able to run a filter that do such rewrites in the site engine as well? As in before pages are rendered?
No redirection happens right now (at least XP does not do it).
Next question is to @espen42 who gained quite a bit of knowledge (And it is out of topic in this issue)
Something we talked about for a very long while but apparently have never implemented. If webapp url doesn't end with "/", we should redirect from
webappUrl
towebappUrl/
. This now causes a lot of issues with PWAs where we have to implement client-side redirect to not have to store assets twice (webapp
andwebapp/
are two different scopes).Consider doing the same for site url without vhost.