Using Rails 1.2 and FastCGI on Apache 1.3. I''m trying to figure out why a request like this isn''t making it into my Rails app: http://www.domain.com/users/show/a.b.c The user id is "a.b.c", and because of the periods in there, Apache is giving this error: File not found Change this error message for pages not found in public/404.html If the :id does not have the periods, it''s fine, and the page is served by Rails. I''m not sure where the problem lies... But, here''s my .htaccess RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] Is this an Apache config thing, or more of a Rails routing thing? --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Ian Zabel wrote:> Using Rails 1.2 and FastCGI on Apache 1.3. > > I''m trying to figure out why a request like this isn''t making it into > my Rails app: http://www.domain.com/users/show/a.b.c > > The user id is "a.b.c", and because of the periods in there, Apache is > giving this error: > > File not found > Change this error message for pages not found in public/404.html > > If the :id does not have the periods, it''s fine, and the page is > served by Rails. > > I''m not sure where the problem lies... But, here''s my .htaccess > RewriteRule ^$ index.html [QSA] > RewriteRule ^([^.]+)$ $1.html [QSA] > RewriteCond %{REQUEST_FILENAME} !-f > RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] > > Is this an Apache config thing, or more of a Rails routing thing?It''s a Rails routing thing for sure. The ''.'' is a param separator. So a, b and c are parsed as separate variables in the url. This allows you to do stuff like: /users/bob #=> :id => ''bob'' /users/bob.xml #=> :id => ''bob'', :format => ''xml'' or /blog #=> :action => ''index'' /blog.rss #=> :action => ''index'', :format => ''rss'' To view the same data in different formats. To prevent it try this in your routes: map.foo ''/users/:id'', :requirements => {:id => /.*/} -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Ah, that makes sense. Thanks! On Apr 12, 5:10 pm, Alex Wayne <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Ian Zabel wrote: > > Using Rails 1.2 and FastCGI on Apache 1.3. > > > I''m trying to figure out why a request like this isn''t making it into > > my Rails app:http://www.domain.com/users/show/a.b.c > > > The user id is "a.b.c", and because of the periods in there, Apache is > > giving this error: > > > File not found > > Change this error message for pages not found in public/404.html > > > If the :id does not have the periods, it''s fine, and the page is > > served by Rails. > > > I''m not sure where the problem lies... But, here''s my .htaccess > > RewriteRule ^$ index.html [QSA] > > RewriteRule ^([^.]+)$ $1.html [QSA] > > RewriteCond %{REQUEST_FILENAME} !-f > > RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] > > > Is this an Apache config thing, or more of a Rails routing thing? > > It''s a Rails routing thing for sure. The ''.'' is a param separator. So > a, b and c are parsed as separate variables in the url. This allows you > to do stuff like: > > /users/bob #=> :id => ''bob'' > /users/bob.xml #=> :id => ''bob'', :format => ''xml'' > > or > > /blog #=> :action => ''index'' > /blog.rss #=> :action => ''index'', :format => ''rss'' > > To view the same data in different formats. > > To prevent it try this in your routes: > > map.foo ''/users/:id'', :requirements => {:id => /.*/} > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---