Alessio Caiazza is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

nolith / redirector http://github.com/nolith/redirector

A small sinatra based URL redirector. Project Logo based on 1LD Arrows v1 by *1lovesdevine (http://1lovesdevine.deviantart.com/) (CC-Attribution-Noncommercial 3.0)

Clone this repository (size: 2.1 KB): HTTPS / SSH
hg clone https://bitbucket.org/nolith/redirector
hg clone ssh://hg@bitbucket.org/nolith/redirector

redirector / redirector.rb

commit
8c5147ce3362
parent
8fb4c7df5750
branch
default

FIX wrong import

1
a9aee208125e
#
2
a9aee208125e
# redirector
3
a9aee208125e
#
4
a9aee208125e
#
5
a9aee208125e
# (c) 2009 - Alessio Caiazza <nolith AT abisso DOT org>
6
a9aee208125e
7
a9aee208125e
require 'rubygems'
8
a9aee208125e
require 'sinatra'
9
a9aee208125e
10
a9aee208125e
REDIRECT_TO='http://abisso.org'
11
a9aee208125e
12
a9aee208125e
get '/' do
13
a9aee208125e
	redirect REDIRECT_TO
14
a9aee208125e
end
15
a9aee208125e
16
a9aee208125e
get '/*' do
17
a9aee208125e
	redirect "#{REDIRECT_TO}/#{params[:splat][0]}"
18
a9aee208125e
end