Skip to content

Instantly share code, notes, and snippets.

@sugamasao
Created April 26, 2010 08:44
Show Gist options
  • Save sugamasao/379110 to your computer and use it in GitHub Desktop.
Save sugamasao/379110 to your computer and use it in GitHub Desktop.
# sinatra でのリダイレクト設定
# hoge/ のような '/' 終わりを '/' 無しへリダイレクト
# ただし、 http://example.com の場合は末尾 '/' が付く
get %r{^(.+)/$} do |c|
redirect c, 303
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment