Internal Route Redirection
If you prefer to use Astro components for your maintenance page, you can redirect to a custom route in your Astro project. This offers greater flexibility to customize the page to your needs.
maintenance({ enabled: true, template: "/custom-maintenance", // Redirects to this route in your Astro site override: "preview",})
This performs a 302 redirect to the specified route when maintenance mode is enabled. You’ll need to:
- Create a page at the specified route in your Astro project (e.g.,
/src/pages/custom-maintenance.astro
) - Build your maintenance page using Astro components, layouts, and styles
This approach lets you use all of Astro’s features for your maintenance page, including:
- Astro components
- Your site’s existing layouts
- CSS frameworks or styling solutions
- Client-side JavaScript when needed
Next Steps
Section titled “Next Steps”Now that you’ve learned about all the available templates, check out these resources:
- Installation Guide - If you haven’t installed the integration yet
- Configuration Options - Learn about all available options
- GitHub Repository - View the source code and contribute