diff --git a/README.md b/README.md index d5b35a7..38394e0 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,26 @@ development, PHP's built-in server can be started from the project root: php -S 127.0.0.1:8080 -t public public/index.php ``` +The included `public/.htaccess` routes Apache and normal Hestia +Nginx-to-Apache installations through `public/index.php`. Apache must have +`mod_rewrite` enabled and permit `.htaccess` overrides. + +For a pure Nginx or Nginx-to-PHP-FPM installation, add this inside the domain's +server configuration: + +```nginx +location / { + try_files $uri $uri/ /index.php?$query_string; +} +``` + +After changing an Nginx configuration, validate and reload it: + +```bash +sudo nginx -t +sudo systemctl reload nginx +``` + The version root is available at `GET /api/v1`. ## Wallet Authentication diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000..bd2a2f6 --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,10 @@ +DirectoryIndex index.php + + + RewriteEngine On + + # Serve real public assets directly and send API routes to the front controller. + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^ index.php [QSA,L] +