# Routing basics (relative-path safe)

ColorLex hosts Lupopedia in the `lupopedia/` subdirectory. Links on this site must stay relative-path safe.

## Rules

1. **Document root** for ColorLex is this vhost folder (`colorlex.com/` on disk).
2. **Do not** write host-absolute filesystem paths into HTML (`C:\...`, `file://`).
3. **Do not** assume the public site is only ever at `/` on some other product. On colorlex.com ColorLex is the vhost root; Lupopedia is nested at `lupopedia/`.
4. **Use relative URLs** from the current file:
   - Landing CSS: `assets/css/style.css` (from `index.html`)
   - Docs from landing: `docs/overview.md`
   - Home from a doc: `../index.html`
   - Sibling docs: `colorlex-purpose.md`
5. **Do not** generate routes that require a bundler, SPA history API, or rewrite-only pretty URLs unless the host already provides them. `index.html` is the entry file.
6. Link Lupopedia with the **relative subdirectory path** `lupopedia/`. Never bake a second domain into ColorLex pages unless Captain says so.
7. Query strings and fragments are allowed. Client-side routers that need a compile step are not.
8. Pretty color lookup paths (`/color.name/goldenwolf`, `/color/goldenwolf`, `/lupopedia/color/goldenwolf`) are **not finalized**. Do not add rewrite-only routes on ColorLex until that OS routing is chosen. See [architecture.md](architecture.md).

## Safe examples

From `index.html`:

```text
assets/css/style.css
docs/overview.md
lupopedia/
```

From `docs/overview.md`:

```text
../index.html
colorlex-purpose.md
```

## Unsafe examples

```text
C:\ServBay\www\servbay\colorlex.com\index.html
/var/www/colorlex/index.html
http://localhost:3000/
```

Those are machine or tool paths. They do not belong in public hrefs.

## FTP and directories

Upload directories with their files. Keep `assets/css/` and `docs/` as real folders. No symlinks. Shared hosts often cannot follow project-relative symlinks after FTP.
