# Domains

One server is often reached under several names: `files.example.com` and `partners.example.com` lead to the same machine. Two cards on the [WebInterface](Users-WebInterface.md) tab of a user make use of that.

## Virtual Domains

"A virtual domain is where multiple domains point to the same computer and server, but based on the domain the user used, you want them to see different results."

A virtual domain sends a user to a start folder that depends on the name they typed into the browser.

| Control | What it does |
|---|---|
| **Add** | asks for **Domain** and **Path**. Both must be given: "Please enter domain", "Please enter path". |
| **Edit**, **Delete** | on a row |
| the handle at the left | changes the order |

| Field | What it is |
|---|---|
| **Domain** | the name the user came in with. `*` stands for any text: `*.example.org` covers every name below example.org. |
| **Path** | a folder of the user, as the user sees it, such as `/partners/` |

A row is shown as `Domain -> Path`. The rows are tried from the top; the first whose domain fits decides, and that folder is the top of everything the user sees in this session. With no row that fits, the user starts at their usual top folder.

### Example: one account, two web sites

The user `anonymous`, who needs no password, has the folders `/site-a/` and `/site-b/`, each with an `index.html`:

| Domain | Path |
|---|---|
| `www.example.com` | `/site-a/` |
| `www.example.org` | `/site-b/` |

With **Serve HTML 'index.html' file instead of directory listing** on, each name shows its own site, served by the same server from the same account.

The same works for people: one account for a partner who reaches `eu.example.com` and `us.example.com` and finds the files of that region.

> [!NOTE]
> A virtual domain chooses where a user **starts**. It is not a wall between customers: both folders belong to the same account. Customers who must not see each other get accounts of their own.

## Alternate HTTP Domains

Other names under which this same server is reached, one per line. The web interface spreads its uploads and downloads over these names.

The reason is a habit of browsers: they open only a few connections to one name at a time. A user who uploads many files at once is slowed by that. With the alternate names, the browser treats the server as several, and more files travel at the same time.

- Every name must lead to this server, and the server's certificate must be good for every one of them. A wildcard certificate, or one that lists all the names, is the usual way.
- The names are used with the port and with http or https as the user came in.
- This is a feature of the Enterprise licence. Without it the box is saved and not used.

## Which name did the user come in with?

Both cards go by the host name the browser sends. Behind a load balancer or a reverse proxy, make sure that it passes the original name on, or every user seems to come in with the proxy's name.
