Im using Slim for the first time, it all works well and i am very happy with it.
But I have a technical question about the server configuration and the rewrite rules we are all using.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]
These rules are rewriting all request to index.php
The thing is to do that, i prefer to use the FallbackResource.
It does the same and it doesn’t invoke the mod_rewrite engine.
FallbackResource /index.php
It all works well, all my routes are triggered, except the main /
The browser is curiously trapped in a kind of 404 response where the connection never ends until the browser tab is closed. I’ve made some fast checking and the weird happens in App.php in the respond() method where the $response->getHeaders() are written in the foreach() loop.
I’m working behind an Nginx proxy and $response->getProtocolVersion() returns “1.1”.
When i change $response->getProtocolVersion() by “1.0”, the loop ends well and then the code keep executing until it fails for some reason.
I couldn’t go further as the deadline of the project im working on is coming soon and Slim is working great with the original RewriteRules, but still, im wondering what is happening. I believe i would prefer to make the use of FallbackResource if possible to avoid the overhead of a mod_rewrite call.