Custom 404 pages and router-level redirect logic with Wix Velo
Module 66: Wix Velo & Dev Mode: Advanced SEO for Developers | Lesson 675 of 688 | 28 min read
By Michael Andrews, Wix SEO Expert UK
A 404 error page is one of the most damaging SEO experiences on any website — it tells Googlebot and users that the content they expected is missing. Wix provides a default 404 page, but with Velo you can build a custom 404 experience that retains users and guides them toward relevant content, and you can implement router-level redirect logic to automatically send users from broken URLs to the correct destination. This lesson covers both capabilities.
The SEO Impact of 404 Errors on Wix Sites
404 errors are a normal part of the web, but a site with a large proportion of 404 errors signals poor maintenance to Google. Googlebot wastes crawl budget on 404 URLs, links pointing to 404 pages pass no authority, and users who hit a 404 page typically leave the site immediately (a signal Google interprets negatively). On Wix, common causes of 404 errors include changed page slugs, deleted pages, URL structure changes, and external links to outdated URLs.
Creating a Custom 404 Page in Wix
Setting up a custom 404 page that retains users
- In the Wix Editor, go to Pages & Menu and look for the "Error Pages" section.
- Click on the "404 Page Not Found" entry to open and edit it.
- Design a helpful 404 page that includes: a clear explanation that the page was not found, a search bar, links to your most important pages, and a prominent button to return to the homepage.
- Add your site navigation menu to the 404 page so users can find what they need.
- Include a brief message that encourages users to contact you if they followed a link from another site.
- Publish the changes to make the custom 404 page live.
Implementing Redirect Logic with the Wix Velo Router
Wix Velo's router allows you to intercept URL requests before they are served and programmatically redirect them to different destinations. This is useful for handling predictable 404 patterns: for example, if you changed your URL structure from /services/SEO to /seo-services, you can write a router function that automatically redirects any request for the old pattern to the new URL with a 301 permanent redirect.
// Backend router file: routers.js
// Handles custom routing and redirect logic in Wix Velo
export function services_Router(request) {
const path = request.path;
// Redirect old /services/SEO pattern to new /seo-services URL
if (path[0] === 'SEO' || path[0] === 'seo') {
return redirect('/seo-services', 301);
}
// Redirect old /services/copywriting to new page
if (path[0] === 'copywriting') {
return redirect('/copywriting-services', 301);
}
// Default: render the services page
return ok('services-page', { path });
}
function redirect(url, statusCode) {
return { status: statusCode, redirectUrl: url };
}
Auditing 404 Errors on Your Wix Site
- Google Search Console: check the Coverage report for pages with 404 status under "Excluded" reasons
- Google Search Console: use the URL Inspection tool to spot-check URLs you suspect may have changed
- Screaming Frog: crawl your site and filter for 4xx response codes to find all broken internal links
- GA4: create a custom report filtering on page title "404" to find which URLs users are hitting
- Bing Webmaster Tools: review the crawl errors report for additional 404 data
How to Build a Custom 404 Page with Redirect Logic Using Wix Velo
A well-designed custom 404 page combined with Velo redirect logic minimises SEO damage from broken URLs and retains users who might otherwise leave your site.
Step-by-step guide to creating a custom 404 page and implementing router redirect logic with Wix Velo
- Open the Wix Editor and navigate to Pages & Menu in the left-hand panel.
- Scroll to the bottom of the pages list to find the "Error Pages" section and click "404 Page Not Found" to open it.
- Design the 404 page to include: a clear message explaining the page was not found, a prominent "Return to Homepage" button, a working search bar, and links to your three most important pages.
- Add your site header and navigation to the 404 page so users can continue browsing without using the browser back button.
- Publish the updated 404 page to make it live on your site.
- Enable Velo Dev Mode via Dev Mode > Turn on Dev Mode in the Wix Editor top menu.
- In the Velo sidebar, navigate to Backend files and create a new file named "routers.js" if one does not already exist.
- Identify the most common URL pattern changes on your site — for example, if you renamed /services to /solutions.
- Write a router function in routers.js that intercepts requests matching the old URL pattern and returns a redirect to the new URL with status code 301.
- Publish the Velo changes to the live site and test the redirect by visiting one of the old URLs in a browser to confirm it redirects correctly.
- Verify the redirect in Google Search Console using the URL Inspection tool — submit the old URL and confirm it now resolves to the new destination.
This lesson on Custom 404 pages and router-level redirect logic with Wix Velo is part of Module 66: Wix Velo & Dev Mode: Advanced SEO for Developers in The Most Comprehensive Complete Wix SEO Course in the World (2026 Edition). Created by Michael Andrews, the UK's No.1 Wix SEO Expert with 14 years of hands-on experience, 750+ completed Wix SEO projects and 425+ verified five-star reviews.