You can create and set custom error pages for visitors
to your website; currently, only 401 (Unauthorized) and
404 (Not Found) errors are supported. To do this, set the
metadata header,
X-Container-Meta-Web-Error
.
Error pages are served with the <status> code
pre-pended to the name of the error page you set. For
instance, if you set
X-Container-Meta-Web-Error
to
error.html
, 401 errors will display
the page 401error.html
. Similarly, 404
errors will display 404error.html
. You
must have both of these pages created in your container
when you set the
X-Container-Meta-Web-Error
metadata, or your site will display generic error
pages.
Set the X-Container-Meta-Web-Error
metadata once for your entire static website.
Example 1.20. Set error pages for static website request
swift post -m 'web-error:error.html' container
Any 2nn
response indicates
success.