Skip to content

Instantly share code, notes, and snippets.

@adamesque
Created June 2, 2011 21:05
Show Gist options
  • Save adamesque/1005334 to your computer and use it in GitHub Desktop.
Save adamesque/1005334 to your computer and use it in GitHub Desktop.
Feature-incomplete Middleman/Rack::Rewrite demo
require 'rubygems'
require 'rack-rewrite'
require 'middleman'
use Rack::Rewrite do
rewrite %r{^/([^\./]+)/?$}, '/$1.html'
end
run Middleman::Server
@adamesque
Copy link
Author

Rewrites /download/ to /download.html, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment