Rack middleware for ditching WWW from request urls by redirecting to non-WWW version of the url.
Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README
www_ditcher.rb

README

= www_ditcher

A tiny Rack middleware with a simple mission: to redirect everyone from WWW to a non-WWW version of the URL.

== Installation

Copy www_ditcher.rb to your lib directory and add this to environment.rb (or in Rails3, application.rb or production.rb):

 require 'www_ditcher'
 config.middleware.use "WwwDitcher"
 

== Examples

 www.something.com                  -> something.com
 www.something.com/some/other.thing -> something.com/some/other.thing
 www.something.com?some-query=true  -> something.com?some-query=true

== Copyright

Copyright (c) 2012 Ilya Sabanin.