https://github.com/no-reply/short-n-sweet
A simple URL shortener
https://github.com/no-reply/short-n-sweet
Last synced: over 1 year ago
JSON representation
A simple URL shortener
- Host: GitHub
- URL: https://github.com/no-reply/short-n-sweet
- Owner: no-reply
- Created: 2012-02-17T17:51:20.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2012-02-17T17:51:35.000Z (over 14 years ago)
- Last Synced: 2025-01-21T18:12:32.495Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 89.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
This is a very simple URL resolver. Put it up at a short domain for a
URL shortener, or add features to create a more advanced ID resolver.
In the Apache config file for your host (or vhost) turn on rewrite and
point all requests at a resolver script. Carve out exceptions for
requests to / and /error, allowing for the index and error pages:
RewriteEngine on
RewriteMap id_map prg:/path/to/resolver.py
RewriteRule ^/$ index.html [L]
RewriteRule ^/error$ error.html [L]
RewriteRule ^/(*)$ ${id_map:$1} [L,QSA]
Name -> Target pairs can be created in a Python interpreter for now.
TODO: add web interface for shortening URIs.
TODO: add web interface for listing existing URIs.