Fix preview deploy without root htaccess
This commit is contained in:
@@ -47,6 +47,19 @@ Fichier :
|
||||
Script cible :
|
||||
- `scripts/deploy-ovh-ftp-target.sh`
|
||||
|
||||
## Note preview
|
||||
|
||||
Le preview ne doit pas embarquer le `.htaccess` de la racine.
|
||||
|
||||
Raison :
|
||||
- ce fichier contient des regles Apache pensees pour `/`
|
||||
- notamment des chemins absolus comme `/index.html` et `/_astro/`
|
||||
- dans `/preview`, ces regles peuvent provoquer un `403 Forbidden`
|
||||
|
||||
Decision :
|
||||
- la cible `preview` retire `dist/.htaccess` avant synchronisation FTP
|
||||
- la cible `production` conserve le `.htaccess` pour la racine publique
|
||||
|
||||
## Usage
|
||||
|
||||
### Preview
|
||||
|
||||
@@ -63,6 +63,13 @@ main() {
|
||||
echo "[deploy-ovh-ftp-target] Skipping build:external (already built)."
|
||||
fi
|
||||
|
||||
# The root .htaccess contains root-scoped Apache rules (`/index.html`, `/_astro/`)
|
||||
# that break the preview when uploaded inside `/preview`.
|
||||
if [[ "$TARGET" == "preview" && -f "${LOCAL_DIR}/.htaccess" ]]; then
|
||||
echo "[deploy-ovh-ftp-target] Removing .htaccess from preview payload."
|
||||
rm -f "${LOCAL_DIR}/.htaccess"
|
||||
fi
|
||||
|
||||
bash scripts/deploy-ovh-ftp.sh "$LOCAL_DIR"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user