Is there a way to redirect www.foo.com/* to foo.com/* using Ruby on Rails without mod_rewrite?

You can add a before_filter in your ApplicationController class ApplicationController Protocol + request. Host_with_port + request. Request_uri end end end.

You need to remove www from front of request. Host_with_port and while matching need to match only start of the hostname followed by a '. '.

– Zimbabao Mar 28 at 6:16 Thanks, this is a great answer! – Mike Christensen Mar 28 at 6:22 Though this is a great answer and would work well, I decided to write a middleware hook instead. I'm not sure what the advantage or disadvantage of this over the before_filter event, however it seemed somehow to be a better place for this code to live.

– Mike Christensen Mar 29 at 5:47 No problems, whatever works for you. P.S. , just checked out KitchenPC.com. I love the design!

– Mike Lewis Mar 29 at 5:48 Thanks! That site's all in . NET, I'm a bit more familiar with that platform :) – Mike Christensen Apr 2 at 7:00.

Yes, you can use redirect. Take a look at the redirection here : edgeguides.rubyonrails.org/routing.html.

This doesn't appear to let me match on the host name, only the document path. – Mike Christensen Mar 28 at 6:23.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions