Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Rack middleware for ditching WWW from request urls by redirecting to non-WWW version of the url.
Ruby
Tree: 8788bdac1d

Fetching latest commit…

Cannot retrieve the latest commit at this time

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) 2010 Ilya Sabanin. See LICENSE for details.

Something went wrong with that request. Please try again.