Case insensitive urls OR url re-writing


#1

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.


#2

Hi,

Onur T. 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.


#3

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…


#4

Onur,

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

— Onur T. removed_email_address@domain.invalid wrote:

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


Yahoo! Mail - PC Magazine Editors’ Choice 2005
http://mail.yahoo.com


#5

IOnur T. wrote:

is there an equivalent in lighttpd?

It’s even called the same thing:
http://www.lighttpd.net/documentation/rewrite.html


#6

is there an equivalent in lighttpd?