I've changed $config['index_page']
to
$config['index_page'] = ''
and also updated my .htaccess file content to:
RewriteEngine on
RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1
but I can't access controllers without putting index.php in my url. So what should I do next?