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.
This commit is contained in:
2026-06-23 11:44:52 -04:00
parent 100accfe34
commit 0b39f08ec7

View File

@ -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&param2=$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.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php81___lsphp .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit