You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using vue-server-renderer, using a redirect in the router just sends the source of the "/to" page as if it were the "/from" page: this means that the same page can be accessed at both "/from" and "/to".
There doesn't seem to be a way to intercept it and send an HTTP redirect instead, which would be preferred, especially given that SEO is mentioned in the vue-server-renderer README!
Maybe the render stream could emit a redirect event instead, somehow?
Happy to help out, just not sure where to start.
The text was updated successfully, but these errors were encountered:
After calling router.push(context.url) in your server entry, you can check router.currentRoute.redirectedFrom to see if the result is a redirect, and return a Promise rejection with code 301/302, similar to this. You can then handle that in your stream's error event: https://github.com/vuejs/vue-hackernews-2.0/blob/master/server.js#L95-L98.
The fact that you have to do it in an error event is less-than-ideal of course, and we will think about how to improve that.
If you were making an application based on hackernews, then there is a check in the file entry-server.js
line 18 if (fullPath !== url) { return reject({ url: fullPath }) }
delete these lines
When using vue-server-renderer, using a redirect in the router just sends the source of the "/to" page as if it were the "/from" page: this means that the same page can be accessed at both "/from" and "/to".
There doesn't seem to be a way to intercept it and send an HTTP redirect instead, which would be preferred, especially given that SEO is mentioned in the vue-server-renderer README!
Maybe the render stream could emit a redirect event instead, somehow?
Happy to help out, just not sure where to start.
The text was updated successfully, but these errors were encountered: