Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3876884
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:26:01+00:00 2026-05-19T22:26:01+00:00

I have a rails app running on my Apache server via Passenger. Occassionally I

  • 0

I have a rails app running on my Apache server via Passenger.

Occassionally I am using some PHP scripts for the website, and have placed them in the public directory.

When I go to /php/ I want Apache to handle the request with the PHP parser and have rails ignore it.

Currently I can go to /php/index.php and it works fine. However I need /php/ to work as well but rails keeps looking for the controller to handle it.

I have a feeling this is something to do with apache rewrite rules, but I cant figure it out.

I have used

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

in the /php/.htaccess file but this doesnt work. I still get the page not found error by Rails.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T22:26:01+00:00Added an answer on May 19, 2026 at 10:26 pm

    I think you can do this in your Passenger app’s main Apache config file – something along the lines of this

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

    inside your VirtualHost block should do the trick (of turning Rails off, at least – turning PHP on is up to you!).

    My answer is based off the ModRails Apache documentation – see section 5.6 for more on the PassengerEnabled command.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Rails app installed on a Slicehost server running Apache 2 and
I have a Rails app that is running on a production server with Apache
I have a rails app running on passenger standalone, which is working perfectly. I
I have a ruby on rails app running a server and sometimes it needs
I have a Ruby on Rails app running on my server, and I can't
We have a web app running on Rails, using Devise and OmniAuth for user
I have this RoR app that calls to RAILS_ROOT. When running it using rails
If I have a Ruby on Rails application running on my Apache shared server
I am hosting a rails 3 app on a cloud VPS using apache passenger
I have a ruby on rails app running on passenger / nginx. The app

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.