I'm making a cakePHP 3 app in which I need to have access to a cgi file in the cgi-bin folder directly. So if I type www.mysite.com/cgi-bin/myfile.cgi I should be able to see the output. The problem I'm having is with the routing, which obviously does not let me access it and instead it asks for the CgiBin controller. I know there is a way using rewrite rules, but I haven't been able to figure it out. I've tried putting the cgi-bin folder in the webroot folder and when I type www.mysite.com/cgi-bin/ I can see the folder index, but when I type www.mysite.com/cgi-bin/myfile.cgi it shows the missing controller error.
What can I do?
cakephp 3 folder/ file structure + cgi
/www /bin/ /cgi-bin/ <----------------- /logs/ ... /webroot/ .htaccess <------------ edit this file
<IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^cgi-bin$ cgi-bin/ [L] RewriteRule ^cgi-bin/(.*) cgi-bin/$1 [L] RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] </IfModule>