Not sure about anything DreamHost specific, but I''ve run into this
problem before. Let me see if I can get this right off the top of my
head. :-)
If your physical file path is downstream from your DocumentRoot
directory (for example, I have a docroot in /www and a Rails app in /
www/rails/application_name), then you need to add a "RewriteBase /
logical/path" to your .htaccess. (Assuming your Rails app should be
accessible from http://appname.example.com/, just add "RewriteBase /".
--
Brad Ediger
866-EDIGERS
On Oct 10, 2005, at 1:51 PM, François Beausoleil wrote:
> Hi !
>
> Has anyone got any tips/tricks on running a Productized Rails app
> on DreamHost ?
>
> Specifically, I get this in my error.log:
> -----------
> [Mon Oct 10 11:39:46 2005] [error] [client 69.70.225.69]
> mod_rewrite: maximum number of internal redirects reached. Assuming
> configuration error. Use ''RewriteOptions MaxRedirects'' to
increase
> the limit if neccessary.
> -----------
>
> As suggested, I know there''s something wrong with the rewrite
> conditions. According to Apache''s docs, the default is 10
> redirects, and I would guess that two are needed to get a
> Productized Rails app going.
>
> Here''s the relevant part of .htaccess (reformatted for
readability):
> -----------
> RewriteEngine On
> RewriteRule ^$ index.html [QSA]
>
> # Hack to fix mod_rewrite bug: we catch the incoming uri as an
> environment variable ''DOC''
> RewriteRule "(.*)" "$1" [env=DOC:$1]
>
> # If the requested file does not exist in SITE_ROOT/public...
> RewriteCond %{DOCUMENT_ROOT}%{ENV:DOC} !-f
> # ... then split its full path up in to manageable pieces ...
> RewriteCond %{REQUEST_FILENAME} ^(.*)/sites/.+$
> # ... and check to see if the file exists in the RAILS_ROOT/public
> # folder...
> RewriteCond %1/public/%{ENV:DOC} -f
> # ... if so, rewrite our requested file to be the RAILS_ROOT one
> RewriteRule ^(.*)$ /generic/%{ENV:DOC} [NS,L]
>
> RewriteRule ^([^.]+)$ $1.html [QSA]
>
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
> -----------
>
> For those of you that don''t know, a Productized Rails app is the
> same as a regular one, but the document root is moved into sites/
> site-name/public. Then all requests are served hierarchically -
> first SITE_ROOT, then RAILS_ROOT if not found in site.
>
> Thanks for any help !
> François
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>