I am using a shared server where I have a plan that allows me to use 3 domains. The problem is the 2 remaining domains are subfolders in the main domain folder. I bought two scripts: the first one, which I am using in the main domain, only works with PHP 8.1, and the second, which is a subfolder in the main domain folder, only works with PHP 7.4.
Here is the main domain .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
<IfModule mime_module>
AddHandler application/x-httpd-alt-php81___lsphp .php .php8 .phtml
</IfModule>
And here is the subfolder .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /subfolderproject.ma/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
<IfModule mime_module>
AddHandler application/x-httpd-alt-php74___lsphp .php .php7 .phtml
</IfModule>
</IfModule>
<IfModule mime_module>
AddHandler application/x-httpd-alt-php74___lsphp .php .php7 .phtml
</IfModule>
When I apply PHP 7.4 to the main project and thus to all subfolders, the main domain obviously doesn’t work and the subfolder project works.
When I apply PHP 8.1 to the main project and PHP 7.4 to the subfolder only, the main project works, and the second project’s index works, but when I go to any other sublink, I get a 500 error.
I hope I explained well my problem,
Thank you everyone.