This page is about Caddy 1 and will go away soon because Caddy 2 is now available. Click here for Caddy 2.

User Guide

http.status

status writes a status code to the response. It does not write a response body.

Syntax

status code path

If you have a lot of status rewrites to group, share a status code by making a table:

status code { path }

Each line describes a base path which should have that status code written.

Examples

For a catch-all status:

status 404 /

To hide the existence of a secret folder:

status 404 /secrets

To hide the existence of multiple folders:

status 404 { /hidden /secrets }

Need help with this feature?

Join us in the Caddy forum, where the open source community gathers to share their knowledge.

Does your company use Caddy?

Purchase a commercial license to use Caddy with your business and for basic email support, along with other benefits!