Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kylef/redirector
Simple web server for HTTP redirecting from one domain to another.
https://github.com/kylef/redirector
Last synced: 10 days ago
JSON representation
Simple web server for HTTP redirecting from one domain to another.
- Host: GitHub
- URL: https://github.com/kylef/redirector
- Owner: kylef
- License: bsd-2-clause
- Created: 2015-04-02T21:06:24.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2021-03-25T21:38:26.000Z (almost 4 years ago)
- Last Synced: 2024-12-23T07:40:19.783Z (19 days ago)
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 4
- Watchers: 4
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# redirector
Simple web server for HTTP redirecting from one domain to another.
## Usage
### Configuration
Configuration is stored in `redirector.yaml` as a YAML file.
```yaml
- 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](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/kylef/redirector)
Once you've deployed, you can easily clone the application and alter the configuration to configure your own domains.
```bash
$ heroku clone -a new-app-name
$ cat redirector.yaml
```Remember to configure your [custom domains](https://devcenter.heroku.com/articles/custom-domains) on Heroku:
```bash
heroku domains:add *.example.com
```### Running the development server
```bash
$ pip install -r requirements.txt
$ python redirector.py
```## License
redirector is released under the BSD license. See [LICENSE](LICENSE).