Skip to content

Instantly share code, notes, and snippets.

@djbender
Created October 9, 2010 05:43
Show Gist options
  • Save djbender/617930 to your computer and use it in GitHub Desktop.
Save djbender/617930 to your computer and use it in GitHub Desktop.
gem 'rack-rewrite', '~> 1.0.0'
require 'rack/rewrite'
use Rack::Rewrite do
r301 %r{^([^\.]*[^\/])$}, '$1/'
r301 %r{^(.*\/)$}, '$1index.html'
end
use Rack::Static, :urls => ["/"], :root => Dir.pwd + '/output'
# Empty app, should never be reached:
class Homepage
def call(env)
[200, {"Content-Type" => "text/html"}, ["There's a problem with my website. Please report the problem to matthew@matthewlang.co.uk/"] ]
end
end
run Homepage.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment