Dumb Thing I Did Recently With Rails

Turns out that dashes are not really valid hostnames in URLs. So, ‘cyclinglog.butlepress.com’ is valid, but ‘cycling_log.butlepress.com’ is not.

Now, Apache virtual hosting will work with underscores just fine, as did 1.1 versions of Rails and Safari 2.0. I think IE never liked it. By “worked” and “liked,” I mean that the browser accepted cookies from the host. If the browser doesn’t accept the cookies, then Rails creates a new session for each request, and that prevents you from logging in to sites like cycling_log.butlepress.com.

Safari 3 show the same behavior. In fact, with Rails 1.2, the only browser that “works” is Firefox.

Anyway, long story short: don’t use underscores in hostnames.

Leave a Reply

You must be logged in to post a comment.