Greg Hauptmann
2006-Oct-24 11:50 UTC
problem with images/stylesheets between windows and unix
Hi, I''m finding my image and stylesheets are resolving fine on windows/webbrick, but not on unix (Dreamhost). I can''t navigate to them on dreamhost and I get a "File not Found - Change this error message for pages not found in public/404.html" One difference is that on dreamhost (fastcgi) I do use Capistrano so my rails application is under /current/, but I have mapped this in the dreamhost domain setup tool. Can anyone spot if something is wrong in my .htaccess file below? Is the idea that static files (e.g. images/stylesheets) are supposed to be covered off in .htaccess with no entries required for them in routes.rb? ==========================================AddHandler fastcgi-script .fcgi AddHandler cgi-script .cgi Options +FollowSymLinks +ExecCGI RewriteEngine On RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f RewriteCond %{SCRIPT_FILENAME} !maintenance.html RewriteRule ^.*$ /system/maintenance.html [L] RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} ^/stylesheets.* RewriteRule .* - [L] RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly" ========================================== Tks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Jason Norris
2006-Oct-24 12:01 UTC
Re: problem with images/stylesheets between windows and unix
Your domain points to your public/ directory right? I''m sure it does but just to check... I don''t think I use the rewrite rules at all, maybe that slows it down a bit as static requests do go through rails. But here is the complete .htaccess which resides in the public/ directory( I haven''t mastered Apache config so I''ve barely touched this file ): AddHandler fastcgi-script .fcgi Options +FollowSymLinks +ExecCGI RewriteEngine On RewriteBase / RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly" Greg Hauptmann wrote:> Hi, > > I''m finding my image and stylesheets are resolving fine on > windows/webbrick, but not on unix (Dreamhost). I can''t navigate to > them on dreamhost and I get a "File not Found - Change this error > message for pages not found in public/404.html" > > One difference is that on dreamhost (fastcgi) I do use Capistrano so > my rails application is under /current/, but I have mapped this in the > dreamhost domain setup tool. > > Can anyone spot if something is wrong in my .htaccess file below? Is > the idea that static files (e.g. images/stylesheets) are supposed to > be covered off in .htaccess with no entries required for them in > routes.rb? > > ==========================================> AddHandler fastcgi-script .fcgi > AddHandler cgi-script .cgi > Options +FollowSymLinks +ExecCGI > > RewriteEngine On > > RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f > RewriteCond %{SCRIPT_FILENAME} !maintenance.html > RewriteRule ^.*$ /system/maintenance.html [L] > > RewriteRule ^$ index.html [QSA] > RewriteRule ^([^.]+)$ $1.html [QSA] > RewriteCond %{REQUEST_FILENAME} !-f > > RewriteCond %{REQUEST_URI} ^/stylesheets.* > RewriteRule .* - [L] > > RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] > > ErrorDocument 500 "<h2>Application error</h2>Rails application failed > to start properly" > ==========================================> > > > Tks > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Greg Hauptmann
2006-Oct-24 20:07 UTC
Re: problem with images/stylesheets between windows and unix
My domain does point to current/public yep..actually I am getting a routing error (recognition railed) when navigating directly to a stylesheet so this probably indicates I guess that the rewrite rules aren''t working. (a) Can anyone spot an issue with the .htaccess file below, and in particular the following portion of it? RewriteCond %{REQUEST_URI} ^/stylesheets.* RewriteRule .* - [L] (b) If I update .htaccess is there anything I need to do to make it take effect? (again I''m on Dreamhost [fastcgi]) Tks On 10/24/06, Jason Norris <jasonmnorris-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Your domain points to your public/ directory right? I''m sure it does but > just to check... > > I don''t think I use the rewrite rules at all, maybe that slows it down a > bit as static requests do go through rails. But here is the complete > .htaccess which resides in the public/ directory( I haven''t mastered > Apache config so I''ve barely touched this file ): > > > AddHandler fastcgi-script .fcgi > Options +FollowSymLinks +ExecCGI > > RewriteEngine On > RewriteBase / > > RewriteRule ^$ index.html [QSA] > RewriteRule ^([^.]+)$ $1.html [QSA] > RewriteCond %{REQUEST_FILENAME} !-f > RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] > > ErrorDocument 500 "<h2>Application error</h2>Rails application failed to > start properly" > > Greg Hauptmann wrote: > > Hi, > > > > I''m finding my image and stylesheets are resolving fine on > > windows/webbrick, but not on unix (Dreamhost). I can''t navigate to > > them on dreamhost and I get a "File not Found - Change this error > > message for pages not found in public/404.html" > > > > One difference is that on dreamhost (fastcgi) I do use Capistrano so > > my rails application is under /current/, but I have mapped this in the > > dreamhost domain setup tool. > > > > Can anyone spot if something is wrong in my .htaccess file below? Is > > the idea that static files (e.g. images/stylesheets) are supposed to > > be covered off in .htaccess with no entries required for them in > > routes.rb? > > > > ==========================================> > AddHandler fastcgi-script .fcgi > > AddHandler cgi-script .cgi > > Options +FollowSymLinks +ExecCGI > > > > RewriteEngine On > > > > RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f > > RewriteCond %{SCRIPT_FILENAME} !maintenance.html > > RewriteRule ^.*$ /system/maintenance.html [L] > > > > RewriteRule ^$ index.html [QSA] > > RewriteRule ^([^.]+)$ $1.html [QSA] > > RewriteCond %{REQUEST_FILENAME} !-f > > > > RewriteCond %{REQUEST_URI} ^/stylesheets.* > > RewriteRule .* - [L] > > > > RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] > > > > ErrorDocument 500 "<h2>Application error</h2>Rails application failed > > to start properly" > > ==========================================> > > > > > > > Tks > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Greg Hauptmann
2006-Oct-24 20:16 UTC
Re: problem with images/stylesheets between windows and unix
PS. Sorry, can I add question c too below (refer previous post re (a) and (b) questiosn): (c) Given that my direct request for one of the image files is making it to rails (as I get a ActionController::RoutingError (Recognition failed for "/images/arrow_right.gif"), and that this request works fine locally on webbrick but not at dreamhost (e.g. http://<domain>/images/arrow_right.gif) then: - should it be the case that the rails routes.rb and the routing method should match up a direct request without having the need for an entry in routes.rb to cover this. That is should I need to put something into routes.rb to cover off the ability to pick up static type files from /public? - any other ideas here? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---