Archive

Archive for February, 2009

Removing the www on a passenger rails app

February 19th, 2009 Jo Potts No comments

I’ve recently moved from nginx with mongrels to phusion passenger on apache.

I like to drop the www subdomain on my sites when I can, but the passenger chaps recommend that you don’t use mod_rewrite with mod_rails (aka mod_rack or even mod_ruby).

So how’s it to be done?

The simple solution is to do the re-write in rails. I found this snippet which does the trick (thanks to RSL):

def trim_www
  if request.subdomains.first == "www"
    if request.subdomains == ["www"]
      redirect_to "#{request.protocol}#{request.domain}#{request.port_string}#{request.path}"
    else
      subdomains = request.subdomains.shift.join(".")
      subdomains << "." unless subdomains.blank?
      redirect_to "#{request.protocol}#{subdomains}#{request.domain}#{request.port_string}#{request.path}"
    end
  end
end

http://gist.github.com/67043

Rescue the Beagles

February 5th, 2009 Jo Potts No comments

It’s off the track of this blog but it simply had to be linked and promoted as it’s the greatest game of all time – especially the music.

Rescue: The Beagles

I wish I had the skills to attempt to make something as perfect as this. I still want to one day have a go…

Categories: general Tags: ,

Garrett’s Sifter and the race to launch

February 4th, 2009 Jo Potts No comments

A snippet from Garrett Dimon’s blog about the creation of his app Sifter:

“Looking back, not finding a way to launch something within the first two months is the single largest mistake I’ve made with Sifter. It’s worked out well, but I definitely wish I could have been getting feedback sooner. It’s made a world of difference in helping Sifter evolve to where it is now.”

Totally agree. I think I’m really onto something with the thing I’m working on right now (bookwhen.com). I started it on the 6th Jan 09, and plan on having the first cut online before the end of the month.

By racing to launch, you can ensure your efforts haven’t been focussed on the wrong areas because there’s literally no time to go off on tangents. By launching the bare minimum, there’s the danger that people may dismiss it at first, but it’s all about the long-term and feedback is the only way to keep on the right path for your users.

Categories: bookwhen, webapps Tags: , , ,