I want to redirect all requests to http://domain.com/blog/category/post to an external blog url say. http://blog.domain.com/category/post.
I ended up, doing something like.
match "/blog" => redirect("http://blog.domain.com/"), :via => [:get]
match "/blog/:section" => redirect("http://blog.domain.com/%{section}"), :via => [:get]
match "/blog/:section/:subsection" => redirect("http://blog.domain.com/%{section}/%{subsection}"), :via => [:get]
match "/blog/:section/:subsection/:post" => redirect("http://blog.domain.com/%{section}/%{subsection}/%{post}"), :via => [:get]
Is there a more genric solution to this? How can I redirect all requests to URLs prefixed with '/blog' to be routed to a particular controller, or to a url with some parameters?