# Building a site here

Your website is the `public_html/` folder. This page lists what the server
does and does not allow — worth reading before you start, and worth
showing to an AI assistant if you are using one to help you code.

Live copy: **https://delta-v.cn/docs/README.md**

## The server

- **PHP only.** Server-side code is PHP, run by the server itself. There
  is no Node.js, no Python, no other runtime, and you cannot start a
  program that keeps running — this is shared hosting.
- **No build step.** Upload the files you want to serve. Nothing is
  compiled or bundled for you.
- **SQLite for data.** Make a `.sqlite` file in your folder and open it
  from PHP. There is no MySQL or other database account for you.
- **Everything in `public_html/`.** PHP can only read files inside your
  site folder, so a file path that goes "up one level" (`../something`)
  will never work and will break the page.
- **HTTPS is automatic** on your `*.delta-v.cn` address.

## Making a page people can open

- Your homepage is `index.html` (or `index.php`) at the top of the folder.
- Directory listing is off, so a folder with no `index.html` gives visitors
  a 403. **That only matters at the top of your site, or at the top of a
  second project you put in a sub-folder.** Folders holding your css,
  images, or data are not meant to be opened on their own — leave them
  alone; a 403 when you browse into one is normal.

## Naming things

- **No spaces in file or folder names.** Use `my-blog`, not `My Blog`.
  Spaces cause real problems with URLs and PHP on this server.
- Use simple names: `letters`, `week-3`, `photo-gallery`.
- Linux is case sensitive: the link `/Style.css` will not find
  `style.css`.

## Files you cannot download (but PHP can still use)

These return a 403 if someone tries to fetch them directly:

```
sql sqlite db bak old save swp env pem key crt ini conf
cfg config yml yaml log err htpasswd
```

That is deliberate — it stops people downloading your database or your
secrets. PHP reads those files normally, so keep your SQLite database
and any `.env` file in the folder and use them as normal.

## `.htaccess`

You may add your own `.htaccess` rules — they work here.

**But one mistake in a `.htaccess` file makes every page on your site
return a 500 error.** Test your site straight after editing it, and keep
a copy of what you had before.

## Space

**250 MB** for the whole site. The meter at the top of your file manager
shows what is left. If you go over, the site pauses until you delete
something.

## Good habits

- `index.html` at the top of your site — and at the top of any second
  project you nest inside it. Not in css, images or data folders.
- Link with relative paths: `css/style.css`, not `/home/you/...`.
- Keep passwords and keys out of your HTML and JavaScript — put secrets
  in `.env` or a `.php` file, neither of which can be downloaded.
- Check the site on a phone as well as a computer.

## Using an AI assistant?

Give it this address and tell it to read it first:

```
https://delta-v.cn/docs/AGENTS.md
```

It contains the same rules written for a coding assistant, so it will
not suggest Node servers, MySQL, paths outside `public_html/`, or
anything else that cannot work here.

## Need help?

Email your teacher: **info@billyhau.hk**
