From 0b39f08ec70a4f9c397b1dec2dc5391ce6321732 Mon Sep 17 00:00:00 2001 From: stephan Date: Tue, 23 Jun 2026 11:44:52 -0400 Subject: [PATCH] Update .htaccess for improved routing and PHP handler configuration This commit modifies the .htaccess file to implement a redirect for non-www domains to www for production clients, while ensuring compatibility with development environments. It also refines the routing rules for CI4 and legacy routes, and adds a PHP handler configuration for version 8.1, enhancing server-side processing capabilities. --- .htaccess | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/.htaccess b/.htaccess index 6fa414d..893bbf6 100644 --- a/.htaccess +++ b/.htaccess @@ -1,24 +1,21 @@ RewriteEngine On RewriteBase / -# ==================================== -# CI4 ROUTES PRIORITAIRES -# ==================================== +# Redirect www — prod client seulement (en dev le redirect etait commente pour la meme raison) +RewriteCond %{HTTP_HOST} !^www\. [NC] +RewriteCond %{HTTP_HOST} !^preprod\. [NC] +RewriteCond %{HTTP_HOST} !\.progiweb\.net$ [NC] +RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=302,L] +# CI4 (dev / v3) — inoffensif en prod si v3 absent RewriteRule ^test/?$ v3/index.php/test [E=IS_CI4:1,L] RewriteRule ^admin-dashboard/?$ v3/index.php/admin-dashboard [E=IS_CI4:1,L] RewriteRule ^resultats-nouveaux/?$ v3/index.php/resultats-nouveaux [E=IS_CI4:1,L] - -# ==================================== -# STOP SI CI4 -# ==================================== - RewriteCond %{ENV:IS_CI4} =1 RewriteRule ^ - [L] -# ==================================== -# LEGACY ROUTES -# ==================================== +RewriteCond %{SCRIPT_FILENAME} !-d +RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^kc/([\w\-]+)/([\w\-]+)/?$ ./kc.php?param1=$1¶m2=$2 [NC,QSA] @@ -39,6 +36,12 @@ RewriteRule ^donate/([\w\-]+)/([\w\-]+)/?/?([\w\-]+)?/?$ ./dons.php?lang=en&code RewriteRule ^page/([\w\-]+)/?(fr|en)?/?$ ./index.php?code=$1&lang=$2 [NC,QSA] +RewriteCond %{REQUEST_URI} !^/(rapports_js|superadm)(/|$) [NC] RewriteRule ^([\w\-]+)/?(fr|en)?/?([\w\-]+)?/?$ ./evenements.php?code=$1&lang=$2&tab=$3 [NC,QSA] -RewriteCond %{REQUEST_URI} !^/(rapports_js|superadm/.*)$ +# php -- BEGIN cPanel-generated handler, do not edit +# Set the "ea-php81" package as the default "PHP" programming language. + + AddHandler application/x-httpd-ea-php81___lsphp .php .php8 .phtml + +# php -- END cPanel-generated handler, do not edit