I also ran into the same problem on Windows. On a Mac, it was easy. If you are trying to exclude index.php from the url, I came across 400 Bad Request Error . This is later fixed with the slash RewriteRule index.php prefix, as shown below
RewriteRule ^(.*)$ index.php/$1 [L]
to
RewriteRule ^(.*)$ /index.php/$1 [L]
Going forward, faced with another question: Failed to load assets / static files. In addition, I had a folder with resources at the root level. I saw a solution similar to adding “assets” to a RewriteCond to eliminate the use of rewriteRule. as,
RewriteCond $1 !^(index\.php|assets)
But that will not work. I have 404 not found error. I later found a solution for this, since
RewriteCond $1 !^(index\.php|\/assets)
And My Rewrite scripts can be found here:
RewriteEngine on RewriteCond $1 !^(index\.php|\/assets) RewriteRule ^(.*)$ /index.php/$1 [L]
Hope this helps and saves a lot of time! :)
source share