kylef / redirector

Simple web server for HTTP redirecting from one domain to another.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

redirector

Simple web server for HTTP redirecting from one domain to another.

Usage

Configuration

Configuration is stored in redirector.yaml as a YAML file.

- host: '*.fuller.li'
  destination: http://{zones[0]}.kylefuller.co.uk{path}
- host: '*querykit.org'
  destination: https://github.com/QueryKit

Where any sub-domain of fuller.li will redirect to the (sub-domain).kylefuller.co.uk/path

Example

Request Redirect
http://mail.fuller.li/login http://mail.kylefuller.co.uk/login
http://www.querykit.org/something https://github.com/QueryKit

Supported Variables

  • scheme
  • host
  • path
  • zones (list) - A list of each domain component

Deploying on Heroku

Click the button below to automatically set up the redirector on your own Heroku account.

Deploy to Heroku

Once you've deployed, you can easily clone the application and alter the configuration to configure your own domains.

$ heroku clone -a new-app-name
$ cat redirector.yaml

Remember to configure your custom domains on Heroku:

heroku domains:add *.example.com

Running the development server

$ pip install -r requirements.txt
$ python redirector.py

License

redirector is released under the BSD license. See LICENSE.

About

Simple web server for HTTP redirecting from one domain to another.

License:BSD 2-Clause "Simplified" License


Languages

Language:Python 100.0%