404 error: Access PHP Application in subfolder of WordPress

Solution:

Those rewriteconds in WordPress’ section of your .htaccess will ensure that any URL that isn’t an actual file or directory will be handled by WP, so your CI never gets a chance to see it. Changing the rewrite rule as follows will exclude your subdir from WP’s override.

RewriteRule ^(?!folder(?:$|/)). /index.php [L]

That’s a negative look-ahead assertion which ensures That CI will get the URL if the path is only /folder, or is or begins with /folder/. You need both cases so Apache can do its normal handling of directory URLs.