How does Rails know a request is for a static (public) file?

kris <rails-mailing-list@...> writes:

When a request comes in to dispatcher for a file (eg. image, html, js) how does it know if it is for a static file from the public folder or it is a request for a dynamic file generated by a controller?

It's actually the other way around. Apache looks for a file matching the request URL in the /public folder, and if it can't find one it passes the entire request to dispach.(f)cgi or wherever to be handled by Rails.

Look at the /public/.htaccess to see how it does that