Change 404 page in vuepress
Clash Royale CLAN TAG#URR8PPP
Change 404 page in vuepress
Is it possible to change / customize the 404 page of Vuepress without ejecting and having to change the whole theme?
I am currently using the enhanceApp.js
, but I'm unsure how I can change the router options (the catchall route) as the Router is already created. The way I got it working right now is this:
enhanceApp.js
router.beforeEach((to, from, next) =>
if (to.matched.length > 0 && to.matched[0].path === "*")
next("/404.html");
else
next();
);
However, this feels like a hack as I always redirect to a custom and existing page containing my 404. Is there a more official way to do this?
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.