# No default .htaccess

**URL:** <https://www.ruby-forum.com/t/no-default-htaccess/188958>\
**Category:** Rails\
**Created:** [May 21, 2010, 3:49am UTC](https://www.ruby-forum.com/t/no-default-htaccess/188958 "2010-05-21T03:49:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![simon780](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@simon780](https://www.ruby-forum.com/u/simon780)\
**Post date:** [May 21, 2010, 3:49am UTC](https://www.ruby-forum.com/t/no-default-htaccess/188958/1 "2010-05-21T03:49:36Z")

</div>

Hey all!

I just created my first RoR project (following this guide  
[http://wiki.rubyonrails.org/start](http://wiki.rubyonrails.org/start)), and I had some trouble getting  
everything to work under apache with passenger. After some debugging I  
found out I simply didn’t had any .htaccess in my public/ folder. People  
around the interwebz seemed to imply there should be one by default, so  
my questions are :

- Why wasn’t there one created with my application?
- Also, I didn’t have any problem when I ran my application using  
webrick. How come?

Thanks.

---

<div class="post-metadata">

**Author:** ![simon780](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@simon780](https://www.ruby-forum.com/u/simon780)\
**Post date:** [May 21, 2010, 12:02pm UTC](https://www.ruby-forum.com/t/no-default-htaccess/188958/2 "2010-05-21T12:02:07Z")

</div>

On May 21, 2:49 am, Simon C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hey all!
> 
> I just created my first RoR project (following this guidehttp://wiki.rubyonrails.org/start), and I had some trouble getting  
> everything to work under apache with passenger. After some debugging I  
> found out I simply didn’t had any .htaccess in my public/ folder. People  
> around the interwebz seemed to imply there should be one by default, so  
> my questions are :

You don’t need a .htaccess in public for passenger (in fact with an  
older app that I migrated to passenger recently, the old .htaccess was  
there stopped passenger from working). It was removed because it was  
only used for fastcgi which is pretty much obsolete as a method for  
deploying rails apps

Fred

---

<div class="post-metadata">

**Author:** ![simon780](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@simon780](https://www.ruby-forum.com/u/simon780)\
**Post date:** [May 21, 2010, 3:52pm UTC](https://www.ruby-forum.com/t/no-default-htaccess/188958/3 "2010-05-21T15:52:02Z")

</div>

Frederick C. wrote:

> On May 21, 2:49ï¿½am, Simon C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Hey all!
> > 
> > I just created my first RoR project (following this guidehttp://wiki.rubyonrails.org/start), and I had some trouble getting  
> > everything to work under apache with passenger. After some debugging I  
> > found out I simply didn’t had any .htaccess in my public/ folder. People  
> > around the interwebz seemed to imply there should be one by default, so  
> > my questions are :
> 
> You don’t need a .htaccess in public for passenger (in fact with an  
> older app that I migrated to passenger recently, the old .htaccess was  
> there stopped passenger from working). It was removed because it was  
> only used for fastcgi which is pretty much obsolete as a method for  
> deploying rails apps
> 
> Fred

Okay… then let me describe the issue I had with passenger (and not  
with webrick), I guess the problem lies elsewhere : in the ‘First  
application’ part of the wiki, you create a table and the correspondent  
controller and views. I just can’t access this controller, I get an  
error 500 from apache. Furthermore, when I checked the log, I get this :

[Thu May 20 21:07:08 2010] [error] [client 127.0.0.1] Request exceeded  
the limit of 10 internal redirects due to probable configuration error.  
Use ‘LimitInternalRecursion’ to increase the limit if necessary. Use  
‘LogLevel debug’ to get a backtrace.  
[Thu May 20 21:07:08 2010] [debug] core.c(3063): [client 127.0.0.1]  
r-\>uri = /index.php  
[Thu May 20 21:07:08 2010] [debug] core.c(3069): [client 127.0.0.1]  
redirected from r-\>uri = /index.php  
[Thu May 20 21:07:08 2010] [debug] core.c(3069): [client 127.0.0.1]  
redirected from r-\>uri = /index.php  
[Thu May 20 21:07:08 2010] [debug] core.c(3069): [client 127.0.0.1]  
redirected from r-\>uri = /index.php  
[Thu May 20 21:07:08 2010] [debug] core.c(3069): [client 127.0.0.1]  
redirected from r-\>uri = /index.php  
[Thu May 20 21:07:08 2010] [debug] core.c(3069): [client 127.0.0.1]  
redirected from r-\>uri = /index.php  
[Thu May 20 21:07:08 2010] [debug] core.c(3069): [client 127.0.0.1]  
redirected from r-\>uri = /index.php  
[Thu May 20 21:07:08 2010] [debug] core.c(3069): [client 127.0.0.1]  
redirected from r-\>uri = /index.php  
[Thu May 20 21:07:08 2010] [debug] core.c(3069): [client 127.0.0.1]  
redirected from r-\>uri = /index.php  
[Thu May 20 21:07:08 2010] [debug] core.c(3069): [client 127.0.0.1]  
redirected from r-\>uri = /index.php  
[Thu May 20 21:07:08 2010] [debug] core.c(3069): [client 127.0.0.1]  
redirected from r-\>uri = /users

Also, here’s what I’ve got in my apache configuration :

NameVirtualHost 127.0.0.1:3000

Listen 127.0.0.1:3000

\<VirtualHost 127.0.0.1:3000\>  
DocumentRoot “/home/simon/projet-web/blog/public”  
DirectoryIndex index.html  
LogLevel debug  
RailsEnv development

\<Directory “/home/simon/projet-web/blog/public”\>  
AllowOverride All  
Options -MultiViews

Thanks again!

---

<div class="post-metadata">

**Author:** ![simon780](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@simon780](https://www.ruby-forum.com/u/simon780)\
**Post date:** [May 22, 2010, 5:07am UTC](https://www.ruby-forum.com/t/no-default-htaccess/188958/4 "2010-05-22T05:07:11Z")

</div>

On May 21, 2:52 pm, Simon C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> \<Directory “/home/simon/projet-web/blog/public”\>  
> AllowOverride All  
> Options -MultiViews

Are you sure there’s not some other stuff (eg some rewrite rules) that  
be being used - I don’t see how just the above + your rails app would  
be doing redirects to a .php url

Fred

---

<div class="post-metadata">

**Author:** ![simon780](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@simon780](https://www.ruby-forum.com/u/simon780)\
**Post date:** [May 22, 2010, 8:49pm UTC](https://www.ruby-forum.com/t/no-default-htaccess/188958/5 "2010-05-22T20:49:44Z")

</div>

Frederick C. wrote:

> On May 21, 2:52ï¿½pm, Simon C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > ï¿½ \<Directory “/home/simon/projet-web/blog/public”\>  
> > ï¿½ ï¿½ ï¿½AllowOverride All  
> > ï¿½ ï¿½ ï¿½Options -MultiViews  
> > ï¿½
> 
> Are you sure there’s not some other stuff (eg some rewrite rules) that  
> be being used - I don’t see how just the above + your rails app would  
> be doing redirects to a .php url
> 
> Fred

That was it! I had forgotten a .htaccess somewhere before the RoR  
project folder… Thanks!
