# Rails production no public directory

**URL:** <https://www.ruby-forum.com/t/rails-production-no-public-directory/194832>\
**Category:** Rails\
**Created:** [September 11, 2010, 7:41pm UTC](https://www.ruby-forum.com/t/rails-production-no-public-directory/194832 "2010-09-11T19:41:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![heldopslippers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b9bd4f/32.png) [@heldopslippers](https://www.ruby-forum.com/u/heldopslippers)\
**Post date:** [September 11, 2010, 7:41pm UTC](https://www.ruby-forum.com/t/rails-production-no-public-directory/194832/1 "2010-09-11T19:41:01Z")

</div>

Hi guys…  
I am deploying a new rails 3 app.  
For this i am using rails 3, thin and apache.

But for hours now i have a problem with the public dir.  
It cannot be accessed beceause it is filtered by the route file.

I have in my routes file the following:  
match ‘/:id(/\*path)’ =\> “websites#index”

it is obvious that this makes nice url /23/helloWorld etc.  
In development mode there is no problem.

When i switch to production however this method is called. And beceause  
for example  
the image.png id doesn’t exist it redirects to /

does anybody know why this happens? (why doesn’t the app first check the  
public folder!)

thanxs!

---

<div class="post-metadata">

**Author:** ![heldopslippers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b9bd4f/32.png) [@heldopslippers](https://www.ruby-forum.com/u/heldopslippers)\
**Post date:** [September 11, 2010, 7:54pm UTC](https://www.ruby-forum.com/t/rails-production-no-public-directory/194832/2 "2010-09-11T19:54:13Z")

</div>

On Sep 11, 6:41 pm, jeljer te Wies [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> it is obvious that this makes nice url /23/helloWorld etc.  
> In development mode there is no problem.
> 
> When i switch to production however this method is called. And beceause  
> for example  
> the image.png id doesn’t exist it redirects to /
> 
> does anybody know why this happens? (why doesn’t the app first check the  
> public folder!)

Are you just proxying all requests to thin ? Typically you configure  
apache to serve up anything that exists in /public, only sending the  
request to your rails backend if it doesn’t

red

---

<div class="post-metadata">

**Author:** ![heldopslippers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b9bd4f/32.png) [@heldopslippers](https://www.ruby-forum.com/u/heldopslippers)\
**Post date:** [September 11, 2010, 8:01pm UTC](https://www.ruby-forum.com/t/rails-production-no-public-directory/194832/3 "2010-09-11T20:01:51Z")

</div>

Well i Tried to do It with apache.  
I did it with setting directory. But this didn’t work.

I have been trying to solve It with apache for hours.  
What should I set in my virtualhost ?

Gr
