Created
August 18, 2011 13:34
-
-
Save bentayloruk/1154063 to your computer and use it in GitHub Desktop.
Rack re-write config
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
require "rack/jekyll" | |
require "rack-rewrite" | |
use Rack::Rewrite do | |
rewrite %r{^\/(.+)\/(\?.*)?$}, '/$1$2' | |
r301 %r{.*}, 'http://bentaylor.org$&', :if => Proc.new {|rack_env| | |
rack_env['SERVER_NAME'] != 'bentaylor.org' | |
} | |
r301 %r{(.*).aspx}, lambda { |match, rack_env| | |
match[1].downcase | |
} | |
r301 %r{^/(.*)/$}, '/$1' | |
end | |
run Rack::Jekyll.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment