I've got a rails application running on my small Apache server via Passenger.

Occassionally I'm with a couple PHP scripts for that website, and also have placed them within the public directory.

After I visit /php/ I would like Apache to handle request using the PHP parser and also have rails neglected.

Presently I can turn to /php/index.php and delay pills work fine. However need /php/ to operate too but rails keeps searching for the controller to deal with it.

I've got a feeling this really is something related to apache rewrite rules, however i cant decipher it.

I have tried personally

RewriteEngine On 
RewriteRule ^php - [L] 
RewriteBase / 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 

within the /php/.htaccess file but this does not work. I get the page not found error by Rails.

I believe this can be done inside your Passenger app's primary Apache config file - something like this

<Directory "/.../myapp/php">
    PassengerEnabled off
    AllowOverride all
</Directory>

within your VirtualHost block should have the desired effect (of turning Rails off, a minimum of - turning PHP on can be you!).

My response is based from the ModRails Apache documentation - see section 5.6 for additional around the PassengerEnabled command.