Commit 36fc90ef authored by Jakob Moser's avatar Jakob Moser
Browse files

Explain .htaccess

parent 3234b41e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -122,7 +122,10 @@ The code itself sends HTTPS requests to the different services to see if they ar
The `.htaccess` files are configuration for the Apache webserver:

* `api/.htaccess` redirects every request to `/api` to `/api/v1` (so you can enter https://status.fsco.li/api in your browser and are automatically directed to https://status.fsco.li/api/v1). This is just a comfort feature.
* `api/v1/.htaccess` is more complex: It rewrites every request to `/api/v1/services` to go to `/api/v1/services.php`. <!-- TODO: Why is this necessary? A: Query parameters --> 
* `api/v1/.htaccess` is more complex: It rewrites every request ...
  * ... to `/api/v1/services` to go to `/api/v1/services.php`.
  * ... to `/api/v1/services/<host>` to go to `/api/v1/services.php?host=<host>`
  * This is necessary because we want to provide a true REST-API experience (where all the request URLs look like paths), but can only use single PHP files to build the application, which take their parameters using queries (e.g., `?host=<host>`).

### Docker