As the title suggests, I want to know if 301 redirect is possible in router.push as I don't see it in documentation.
Asked
Active
Viewed 2,265 times
1
-
1Does this even make sense to you? Javascript is a client-side programming language, all it can do is replace the current browser url (eg. using `window.location.href`). It doesn't mess with the response, that's server's side job. – Mike Doe Feb 26 '19 at 13:39
-
@glacasandile This is not a duplicate. Cause it's a specific question for a router.js application. It is possible with 'redirect'. Example: `{ path: '/a', redirect: '/b' }`. With that you could redirect a page without a trailing-slash to one with a trailing-slash. More information can be found on the documentation of vue router: [Redirect and Alias | Vue Router](https://router.vuejs.org/guide/essentials/redirect-and-alias.html#redirect) – klediooo Sep 01 '20 at 12:11