开发者

subdomain routing

When a user types in his username.example.com I read out the subdomain and render the users开发者_Python百科 personal page.

map.home '', :controller => 'users', :action => 'show'

the problem is that I now want to add custom subdomains like www, '', help and so on.

What I do now but doesn't work: I read the subdomain in the applications controller and when I catch help I redirect to the helps controller. Redirecting doesn't work because applications controllers is calles again and I end up in a infinit loop.

Someone knows how I approach this?

Thanks


We use a plugin for this:

http://github.com/mbleigh/subdomain-fu

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜