redirect 403 in .htaccess is bouncing my custom ajax pages

I have some custom functions I hit in ajax requests that I put in custom/modules/modulename/mycustomfile.php. Something is amiss in one of my environments because these requests get bounced to the 403 page. The requests go through if I comment out this line in .htacess:

RedirectMatch 403 (?i)/+(soap|cache|xtemplate|data|examples|include|log4php|metadata|modules)/+.*\.(php|tpl)

I did some trial and error and moved a simple phpinfo() file through the directories and found:
custom/modules/modulename/phpinfo.php gets 403
custom/modules/phpinfo.php gets 403
custom/phpinfo.php works

What is your version of SuiteCRM? There was a .htaccess bug a while back, it might have been in 7.10.0 but I am not sure.

Check recently closed GitHub issues related to that…

I ultimately fixed this by moving the ajax file into a controller action which was a better way to handle it anyway.