Files
PS_Launcher/server/.htaccess
j.foucher c501115612 Server: portable rewrite + JSON-only error handler
The previous .htaccess used PATH_INFO (api/index.php/$1) which OVH mutualisé
does not always allow, producing an Apache 500 HTML page that masked our own
JSON error reporting.

Switch to query-string routing (?route=...): same effect, works everywhere.
Add a global exception handler in index.php that emits JSON errors only —
no more opaque Apache 500.

Add a /api/debug endpoint that reports PHP version, sodium availability,
pdo_mysql, and whether versions.json is found. Useful for diagnosing
shared-hosting setup before adding license logic.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 09:07:22 +02:00

16 lines
553 B
ApacheConf

RewriteEngine On
RewriteBase /PS_Launcher/
# HTTPS forcé (si le mutualisé OVH ne le force pas déjà)
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Pas de listing de répertoires
Options -Indexes
# /PS_Launcher/api -> api/index.php
# /PS_Launcher/api/foo -> api/index.php?route=foo
# (passage par query string : pas de PATH_INFO, marche partout)
RewriteRule ^api/?$ api/index.php [QSA,L]
RewriteRule ^api/([^?]+)/?$ api/index.php?route=$1 [QSA,L]