# =========================================== # Frontend — ${DOMAIN} # =========================================== ServerName ${DOMAIN} ServerAdmin webmaster@localhost AddDefaultCharset UTF-8 DocumentRoot ${APP_PATH}/frontend/web/ # =========================================== # Backend + API aliases (path-based routing) # =========================================== Alias /admin ${APP_PATH}/backend/web/ Alias /api ${APP_PATH}/api/web/ Options FollowSymLinks AllowOverride none Require all granted DirectoryIndex index.php index.html RewriteEngine On # Don't rewrite requests headed for /admin or /api RewriteCond %{REQUEST_URI} !^/admin RewriteCond %{REQUEST_URI} !^/api RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ index.php [L] Options FollowSymLinks AllowOverride none Require all granted DirectoryIndex index.php index.html RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ index.php [L] Options FollowSymLinks AllowOverride none Require all granted DirectoryIndex index.php index.html RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ index.php [L] # =========================================== # Security: block dotfiles globally # =========================================== RewriteEngine On RewriteRule (^|/)\. - [F,L] # =========================================== # Friendly route fixes # =========================================== RewriteCond %{REQUEST_URI} ^/admin$ RewriteRule ^ /admin/ [R=301,L] RewriteCond %{REQUEST_URI} ^/api$ RewriteRule ^ /api/ [R=301,L] # =========================================== # Logs # =========================================== ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # =========================================== # Backend — ${BACKEND_DOMAIN} # =========================================== ServerName ${BACKEND_DOMAIN} ServerAdmin webmaster@localhost AddDefaultCharset UTF-8 DocumentRoot ${APP_PATH}/backend/web/ Options FollowSymLinks AllowOverride none Require all granted DirectoryIndex index.php index.html RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ index.php [L] # =========================================== # Security: block dotfiles globally # =========================================== RewriteEngine On RewriteRule (^|/)\. - [F,L] # =========================================== # Logs # =========================================== ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined