# Ruby path?

**URL:** <https://discuss.rubyonrails.org/t/ruby-path/9005>\
**Category:** rubyonrails-talk\
**Created:** [February 20, 2007, 5:20am UTC](https://discuss.rubyonrails.org/t/ruby-path/9005 "2007-02-20T05:20:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DigitalWarfare](https://avatars.discourse-cdn.com/v4/letter/d/3e96dc/32.png) [@DigitalWarfare](https://discuss.rubyonrails.org/u/DigitalWarfare)\
**Post date:** [February 20, 2007, 5:20am UTC](https://discuss.rubyonrails.org/t/ruby-path/9005/1 "2007-02-20T05:20:22Z")

</div>

Do I have to setup some sort of .htaccess file?

right now I have ruby setup with a small demo app called: "say"

If you browse to the url: [http://www.myurl.com/ruby\_test/](http://www.myurl.com/ruby_test/) you see the whole directory contents, you can see what's in the controllers, etc. I don't want that to happen.

Additionally, if you HAVE to browse to the public folder in the demo app just execute the pages such as: /public/say/hello/. I want it work like a normal directory and if you type in the url: url.com/ruby\_test/ say/hello it should work. Do I need a .htaccess file to do this? What are remedies around this?

---

<div class="post-metadata">

**Author:** ![DigitalWarfare](https://avatars.discourse-cdn.com/v4/letter/d/3e96dc/32.png) [@DigitalWarfare](https://discuss.rubyonrails.org/u/DigitalWarfare)\
**Post date:** [February 20, 2007, 9:55pm UTC](https://discuss.rubyonrails.org/t/ruby-path/9005/2 "2007-02-20T21:55:29Z")

</div>

For anyone curious on how this can be done, it requires two edits!

One add .htaccess file with (this goes in the directory above public: RewriteEngine On RewriteRule ^public/(.\*)$ - [L] RewriteRule ^(.\*)$ public/$1 [L,QSA]

Next edit config/environment.rb: Add this to the end:

ActionController::AbstractRequest.relative\_url\_root = "/ rails\_app\_directory\_name\_here"
