Rewriting consists of two parts. The first indicates that if the requested file name is a regular file with a size larger than 0 ( -s ), a symbolic link ( -l ) or directory ( -d ) are copied to nowhere, for example. do not take any action. [NC,L] means that the rule is not case sensitive, and the last rule meets these conditions.
All other requests are redirected to /vote/public/index.php .
The purpose of this overwrite is that an actual, existing file can be retrieved from the server without interference. Without the first rule, each file request (css and js files, images, etc.) would go to index.php , which would ruin the situation quite badly.
This is usually written in one ad. You can cancel the conditions, and then you can also render statemens [OR] :
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-s RewriteCond %{REQUEST_FILENAME} !-l RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^.*$ /vote/public/index.php [NC,L]
This is equivalent to the original statement.
Tatu Ulmanen
source share