Skip to content
This repository has been archived by the owner on Feb 7, 2020. It is now read-only.

Subdomains Handling

botanicus edited this page Sep 13, 2010 · 10 revisions

This page is up to date for Rango 0.1.

You may want to have for example your application at rango-project.org, but your media files at media.rango-project.org. In production environment it will be server job to take care about it, but what about the development environment? And mainly what if you just want to have a subdomain for each user, like at github pages I have botanicus.github.com?

Setup Development Environment

/etc/hosts

127.0.0.1	localhost
127.0.0.1	blog.localhost

You don’t have to restart computer, not even your browser, it should just work.

If you need more complex setup, something like *.localhost, you have to use PAC man

Write the Middleware

Rango::Request.subdomains(tld_length)

- Extracting subdomains in Sinatra
- Phusion, Rack, Sinatra and Subdomains
- simple subdomain app deploying with passenger
- http://gist.github.com/166195
- Subdomains Development Sucks
- http://blog.plataformatec.com.br/2009/12/subdomains-and-sessions-to-the-rescue/

Clone this wiki locally