At least one problem I see is that the rewrite rules in the .htaccess file are incorrect.
Given these rules:
RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.*)$ public/index.php [QSA,L]
These rules are equal:
RewriteCond %{REQUEST_FILENAME} -s [OR] # A request is a regular file with a size> 0 RewriteCond %{REQUEST_FILENAME} -l [OR] # A request to a file that is a symbolic link RewriteCond %{REQUEST_FILENAME} -d [OR] # RewriteCond %{REQUEST_FILENAME} -d [OR] Request to directory that exists
And if any of the above values ββis true, the request is rewritten to public/index.php , which is incorrect. If the request is for a file that exists on disk, you DO NOT want to overwrite it; instead, you just want to serve this file.
The correct .htaccess file should look something like this:
RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ public/index.php [NC,L]
This means that if the request is for a file with a size> 0, a directory, or a symbolic link, then send the request to the actual requested file ( RewriteRule ^.*$ - ). If none of these conditions is true, rewrite the request to index.php.
In a separate note, I would like to go and completely get rid of the public directory. Take the contents of public and put them in /dsa . dsa now your public folder. You can store the application directory anywhere on the system, or if you need to put it in the dsa folder due to file system restrictions, be sure to add the rule to your .htaccess file, which prevents all access to the application . Then you just need to quickly make changes to the index.php file by specifying the correct path to the application using the APPLICATION_PATH constant.
I believe that these two changes should solve your problems.