KLYRN
KLYRN Web
All documentation
  1. Home
  2. Docs
  3. Domains

Domains

A site answers for its own name. Every other name is either an alias, the same website under a second name, or a redirect.

Two kinds of name

KLYRN has no addon domain, parked domain or subdomain type. It has two kinds:

alias
The same website, under another name. Same files, same database, same certificate.
redirect
Visitors are sent somewhere else, keeping the path and the query string.

A subdomain that should show a different website is its own site. For shop.example.com with its own files and its own database, run klyrn site create shop.example.com. Use the parent's account if they should share a home. A subdomain that should show the same website is an alias.

Adding an alias

klyrn site domain list example.com
klyrn site domain add example.com shop.example.com
klyrn site domain add example.com example.net
klyrn site domain remove 7        # the id from 'domain list'

An alias joins the vhost's server_name and goes onto the Let's Encrypt certificate as soon as it resolves to this server. Until then the name is listed with its DNS state (ready, missing, elsewhere or unknown). The certificate is ordered for the names that do resolve.

A lookup that fails is reported as its own state and retried once after 300 ms. It is never reported as "no record".

KLYRN refuses to add a name that is:

  • The site's own domain.
  • www.<domain> while www handling is set to alias: turn that off first.
  • The panel's own hostname.
  • Already a site on this server, or already pointing at another site. The message says which.

Unlike site creation, a leading www. on a domain row is kept. Typing www.example.net never gives you example.net.

Redirects

klyrn site domain add example.com old.example.com --redirect-to https://example.com
klyrn site domain add example.com legacy.example.com --redirect-to https://example.com/new --code 302

A redirect gets its own nginx server block on both ports, and the name goes on the certificate. Without that, a visitor arriving at https://old.example.com would meet a certificate for a different name before the redirect could run.

The destination is validated because it is written into an nginx configuration file:

  • Required, and no longer than 500 characters.
  • Must begin https:// or http://.
  • May not contain a newline, tab, quote, backslash, semicolon or brace.
  • The code is 301 (permanent, the default) or 302 (temporary). Nothing else.

www handling

A site created without --no-www serves www.<domain> as an alias and puts it on the certificate if it resolves here. Change it later:

klyrn site set example.com --www alias
klyrn site set example.com --www none

To redirect www to the apex, set --www none and add www.example.com as a redirect. The certificate covers it either way.

Discord WhatsApp