Howdy- I''m converting a website of mine over to Rails (which is such a pleasure), but I''m trying to maintain compatibility with my existing URL structure. For this reason, I''m trying to make URLs that look like: http://gaminghaven.com/Games/View/145/ This is the same URL structure I used for the PHP-based site (which is where that link''ll take your right now). Rails currently does the right thing and ignores the closing slash on the URL when it is directly typed in (or from links, whatever), but url_for, link_to, etc, all generate URLs without the closing slash. I would prefer if the slashes were their, since that''s how I''m already indexed in Google. I know I can just added rewrite entiries to fix this, but to avoid extraneous redirects, I was hoping that somebody would have a solution that would just generate the URLs with the final slash included. Any suggestions would be appreciated. Cheers, Ben
On Tuesday 15 March 2005 12:37, Ben Schumacher wrote:> etc, all generate URLs without the closing slash.This is done to facilitate cacheing. There are a few ways you could defeat this. For example, you could override url_for to append a ''/'' to the generated path. dont-blame-me-if-caching-doesnt-like-that-ly, Nicholas -- Nicholas Seckar aka. Ulysses
Nicholas Seckar <nseckar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> This is done to facilitate cacheing. There are a few ways you could defeat > this. For example, you could override url_for to append a ''/'' to the > generated path.Would it be feasible to have an option to override this on a link basis? For example, on a typical blog many of us like to have urls like /archive/2005/ for the archive, but /date/some-slug for individual posts. It''s not a big deal, but it would probably help secure Rails as the king of cool and configurable urls :) -- Regards, Stian Grytøyr