views:

23

answers:

1

I have a rails app that is accessible through multiple URLs, I was wondering what is the best way to rewrite the URL to use the main domain name, abc.com.

I have a bunch of other domain names like 1kjsdf.info 2lksjdfs.info 3sldkjfds.info ... in total 50 of these kinds of domains.

They all end in info if that makes it easier. I used lighttpd as my webserver, is there a way to set things up so that when the user goes to 1kjsdf.info\profile, the url is rewritten as adc.com\profile?

+2  A: 

You should probably do this in lighttpd, not Rails.

http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModRewrite

It will be much faster to service these requests in the HTTP server before letting it get to Rails.

Lou Franco