# Serving static html files out of /public

**URL:** <https://www.ruby-forum.com/t/serving-static-html-files-out-of-public/141574>\
**Category:** Rails\
**Created:** [June 27, 2008, 7:02am UTC](https://www.ruby-forum.com/t/serving-static-html-files-out-of-public/141574 "2008-06-27T07:02:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/838e76/32.png) [@rob](https://www.ruby-forum.com/u/rob)\
**Post date:** [June 27, 2008, 7:02am UTC](https://www.ruby-forum.com/t/serving-static-html-files-out-of-public/141574/1 "2008-06-27T07:02:11Z")

</div>

Hi all,

I have added a rails app to a pre-existing static website. I have put  
all the legacy content (i.e. html files and images) in the public dir  
and sub-dirs as appropriate.

Everything works fine - both the rails app and the static. My problem  
is it looks like rails is trying to handle the requests for html files  
because I get lots of log entries like the following:  
`
Processing ApplicationController#index (for 123.456.789.231 at
2008-06-25 17:02:56) [GET]
Session ID: 819a6bbb60000b27fceeee
Parameters: {}`

ActionController::RoutingError (No route matches “/somepage.htm” with  
{:method=\>:get}):  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/  
routing.rb:1441:in `recognize_path' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ routing.rb:1424:in`recognize’

I’m using Apache and fcgi. Anyway I can get these requests process  
more cleanly?

Thanks,

---

<div class="post-metadata">

**Author:** ![rob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/838e76/32.png) [@rob](https://www.ruby-forum.com/u/rob)\
**Post date:** [June 27, 2008, 9:53am UTC](https://www.ruby-forum.com/t/serving-static-html-files-out-of-public/141574/2 "2008-06-27T09:53:40Z")

</div>

On Jun 27, 6:01 am, rob [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m using Apache and fcgi. Anyway I can get these requests process  
> more cleanly?

We use a rewrite rule so that any url that corresponds to an actual  
file on disc is handled directly by apache.

Fred
