CodeIgniter 4 Apache Access Denied

CodeIgniter 4 Access denied message and a 403 response code in browser when hosting with Apache in Laravel Homestead.

It works fine with php spark server but when hosting with Apache the problem happens.

The solution is to update the /public/.htaccess file so that

RewriteRule ^([\s\S]*)$ index.php/$1 [L,NC,QSA]

becomes

RewriteRule ^([\s\S]*)$ index.php?/$1 [L,NC,QSA]

note the extra ? character after .php

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.