Forum: Ruby on Rails case insensitive urls OR url re-writing

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
043efdc2a79afbfec84696f50fd42163?d=identicon&s=25 onurturgay (Guest)
on 2005-11-12 12:49
(Received via mailing list)
Hi,

How can I make my urls case-insensitive? And where can I put the code
that
can rewrite some of the routes that I have been using. (not all of them)

i.e. I want all options after /blog/ be kept as is but all options after
/comment/ will be downcased

In short, all my urls except /blog/ will be downcased, blog will remain
as
is.

I thought using an application controller method but couldnt be sure..
What
do you recomennd?

Thanks in advance.
Eb96620826312516bb4a2d6deeee6688?d=identicon&s=25 jc.michel (Guest)
on 2005-11-12 12:49
(Received via mailing list)
Hi,

Onur Turgay wrote:
> In short, all my urls except /blog/ will be downcased, blog will remain
> as is.
>
> I thought using an application controller method but couldnt be sure..
> What do you recomennd?

I'm not sure of what you want to do.
Try to use a catchall in your route:

map.connect '/blog/*bloguri', :controller => 'blog', :action => 'view'

and in your controller, use the bloguri array and change case as you
want.
043efdc2a79afbfec84696f50fd42163?d=identicon&s=25 onurturgay (Guest)
on 2005-11-12 12:49
(Received via mailing list)
what I wanted to mean was

if someonw calls /COMMent/VIEW
i want to redirect him/her to /comment/view

if someone calls BLOG/BLALALAL
i want to redirect him/her to blog/BLALALALA

except for blog, all urls will be downcased..
437d27bcbaab9563f8ed479870933bc7?d=identicon&s=25 dcabbar (Guest)
on 2005-11-12 12:49
(Received via mailing list)
Onur,

Use apache mod_rewrite instead, it is much more easier
and way more faster than RoR for this specific
requirement...

--- Onur Turgay <onurturgay@gmail.com> wrote:

>
> > > I thought using an application controller method
> change case as you want.
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>





__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
043efdc2a79afbfec84696f50fd42163?d=identicon&s=25 onurturgay (Guest)
on 2005-11-12 12:49
(Received via mailing list)
is there an equivalent in lighttpd?
A7a7500626778d47f8fd974f5564cf3e?d=identicon&s=25 rosskarchner (Guest)
on 2005-11-12 12:49
(Received via mailing list)
IOnur Turgay wrote:
> is there an equivalent in lighttpd?

It's even called the same thing:
http://www.lighttpd.net/documentation/rewrite.html
This topic is locked and can not be replied to.