If an error occurs while rendering the page, Scroll Viewport locates the appropriate error template to render that error.

Creating Velocity templates for error pages

Create a new Velocity template called error.vm, then fill it with the following content and upload it:

Creating a default error-page

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
		<title>$statusCode - $statusText</title>
		<h1>$statusCode - $statusText</h1>
		<p>An error occurred</p>

Redirect to another page

To redirect from an error page to another page, implement the following code into your error page:

Redirecting from an error 404 page to the homepage

#if ($statusCode == 404)
    <script>window.location = "$space.link";</script>

In this example, the user would be redirected to the homepage of the space if an 404 error occurs.