Topic: Redirects using a regex?

I need to create a redirect so whenever someone goes to anything beneath a certain folder (e.g. they will be redirected to

I know how to do the redirect part but not sure how to use a regex for whatever is entered after the first directory. Any help would be greatly appreciated.

Re: Redirects using a regex?

There is a good article about that kind of thing here. I imagine you'd want something like:

redirect_to_url path.gsub(%r{}, ''), true if path.match %r{/folder/}


Re: Redirects using a regex?

This sounds like a job for mod_rewrite if you're using apache

Railscasts - Free Ruby on Rails Screencasts