URL shortener
Let's put a URL shortener in ICEkit.
We (at ACMI) want to be able to:
a) have many short URLs point to the same long URL, with different UTM codes (or perhaps other GET parameters).
b) specify short URLs, but generate a short one made if none is specified.
c) shared short URLs retain social sharing metadata.
Proposed approach:
-
create a
short_urlsapp in ICEkit, with a model that maps a unique shortcode to an ICEkitURL (which can be a GFK or an arbitrary URL). Create an admin UI for -
create an inlineadmin for ICEkit content that allows a user to specify one or more shortcodes for content, with potentially varying GET strings. If no shortcode is specified, one is generated. If a duplicate shortcode is specified, a validation error is made.
-
serve requests to shortcodes as redirects to the destination URLs.
-
serve ICEkit pages with a
<link rel="shortlink" href="http://www.mywebsite.com/shortcode">in the header. -
Implement short URLs in such a way that social sharing metadata is conveyed when the short link is shared.
Questions:
a) does this supersede the existing redirects module? should we migrate away from it? I propose it does and we should. b) should short URLs be tied to one domain or work with any domain? Should the main site domain be one of these? I propose that the solution be domain-agnostic. The short domain to use should be a setting, defaulting to the usual domain. c) should this URL do any tracking/analytics? I propose not for now - the UTM code can be used for GA. d) should short URLs allow slashes? I propose yes, because it is necessary for a) above.
cc @andrewserong
@cogat That sounds like a great Idea. Please can you fork the repo and make a pull request when you're ready?