Created
October 9, 2010 05:43
-
-
Save djbender/617930 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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