We need to alter the .htaccess
file, so that the request for the public
files is not passed to the index.php
file, but instead goes into to the public
folder and finds the requested resource.
1. Start by opening up the .htaccess file that's in the root of our project.
2. Add the following highlighted code:
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^css/([^/]+) public/css/$1 [L] RewriteRule ^js/([^/]+) public/js/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?request=$1 [QSA,L] </IfModule>