I can get the FastCGI app to load just fine such that *anything* in the URL is passed along to the app. However, I want to exclude static resources so I tried adding a RewriteCond using !-f on the REQUEST_FILENAME. It just seems to ignore it entirely and the FastCGI app ends up taking the request instead of Apache serving up the file.
Code: Select all
AppClass /Sites/CioccolataTest.webapp/Contents/MacOS/CioccolataTest -port 5065
FastCgiExternalServer /Sites/CioccolataTest.webapp/Contents/MacOS/CioccolataTest.fcgi -host 127.0.0.1:5065
<VirtualHost *:80>
ServerName cioccolata-test.webdev
DocumentRoot "/Sites/CioccolataTest.webapp/Contents/Resources/static"
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ /Sites/CioccolataTest.webapp/Contents/MacOS/CioccolataTest.fcgi/$1 [QSA,L]
</VirtualHost>So out of desperation (and for the sake of my own sanity) I wrote a one-off rule for paths starting with "/hello". Low and behold, this correctly serves up the text file and all other URLs route through to my FastCGI application. Which begs the question, why doesn't the previous rule work?
Code: Select all
AppClass /Sites/CioccolataTest.webapp/Contents/MacOS/CioccolataTest -port 5065
FastCgiExternalServer /Sites/CioccolataTest.webapp/Contents/MacOS/CioccolataTest.fcgi -host 127.0.0.1:5065
<VirtualHost *:80>
ServerName cioccolata-test.webdev
DocumentRoot "/Sites/CioccolataTest.webapp/Contents/Resources/static"
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/hello
RewriteRule ^/(.*)$ /Sites/CioccolataTest.webapp/Contents/MacOS/CioccolataTest.fcgi/$1 [QSA,L]
</VirtualHost>