3

I have a subdomain with service I am going to kill.

I'd like to use 410 to mark it as such.

Is there a way to do that with lighttpd without resolving to mod_magnet and lua scripts?

Almad
  • 151

1 Answers1

3

Set the document root to an otherwise empty directory, and use a dynamic error handler to send a 410 response.

Example:

$HTTP["host"] == "gone.example.com" {
  server.document-root = "/var/www/gone"
  server.error-handler-404 = "/gone.php"
}

Where /var/www/gone/gone.php contains something like the following:

<?php
header("HTTP/1.1 410 Gone");
header("Status: 410 Gone");
Michael Hampton
  • 252,907