<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>URL shortening &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/url-shortening/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>on web development</description>
	<lastBuildDate>Tue, 13 Feb 2018 08:18:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>Make your own link shortener</title>
		<link>/2010/01/28/make-your-own-link-shortener/</link>
		<comments>/2010/01/28/make-your-own-link-shortener/#respond</comments>
		<pubDate>Thu, 28 Jan 2010 08:09:44 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Hash table]]></category>
		<category><![CDATA[Twitter Inc]]></category>
		<category><![CDATA[URL]]></category>
		<category><![CDATA[URL shortening]]></category>

		<guid isPermaLink="false">/?p=968</guid>
		<description><![CDATA[Why you should do that? First of all what’s a link shortener? Such online software exists and it’s widely used by the customers. Sites like bit.ly became extremely popular because of the growth of web apps like Facebook and especially Twitter. The simple goal that they achieve is to convert a long website uri into &#8230; <a href="/2010/01/28/make-your-own-link-shortener/" class="more-link">Continue reading <span class="screen-reader-text">Make your own link shortener</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/01/26/prevent-link-default-action-when-mousedown-and-mouseup-fires/" rel="bookmark" title="Prevent link default action when mousedown and mouseup fires!">Prevent link default action when mousedown and mouseup fires! </a></li>
<li><a href="/2010/06/04/one-form-multiple-db-records/" rel="bookmark" title="One Form &#8211; Multiple DB Records">One Form &#8211; Multiple DB Records </a></li>
<li><a href="/2010/03/09/what-make-javascript-closures-work/" rel="bookmark" title="What make JavaScript closures work?">What make JavaScript closures work? </a></li>
<li><a href="/2010/11/12/how-to-make-mp4-progressive-with-qt-faststart/" rel="bookmark" title="How to Make MP4 Progressive with qt-faststart">How to Make MP4 Progressive with qt-faststart </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Why you should do that?</h2>
<p>First of all what’s a link shortener? Such online software exists and it’s widely used by the customers. Sites like bit.ly became extremely popular because of the growth of web apps like Facebook and especially Twitter. The simple goal that they achieve is to convert a long website uri into a short unique one. Beside that they give more information about who clicked that link and some useful stats along with that.</p>
<p>The question is why to make your own link shortener? One of the main reasons why is to paste links containing in plaintext your domain. In the case of <strong>http://stoimen.com/</strong> instead of using <strong>http://bit.ly/xxxxx</strong> it will be great if the link was something like <strong>http://stoimen.com/xxxx</strong> than pasting it into Twitter or wherever I get the primary impression of my domain.</p>
<h2>How to &#8230;</h2>
<p>It should be no mystery how to make your own. In fact you’ll need only one more table into the database, as this is the most common way to achieve it. Of course you can do that with no database using the file system to store the hash table in whatever format you’d like.</p>
<p>In the case of the DB solution you can simply make a table with three columns containing the unique id of the row, the short and the full link. Thus requesting some short link the db will return the “real” full uri. You can simply drop the short column if you’d like more efficient solution. Thus the unique identifier may become short link. That may be really fast if you’ve an index on the full link column.</p>
<p><strong>See the example below:</strong></p>
<blockquote>
<pre>id | short_link | full_link
1  | qwrt 	| /blog/2010/01/27/theory-of-caching-zend_cache-zend-optimizer</pre>
</blockquote>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/01/26/prevent-link-default-action-when-mousedown-and-mouseup-fires/" rel="bookmark" title="Prevent link default action when mousedown and mouseup fires!">Prevent link default action when mousedown and mouseup fires! </a></li>
<li><a href="/2010/06/04/one-form-multiple-db-records/" rel="bookmark" title="One Form &#8211; Multiple DB Records">One Form &#8211; Multiple DB Records </a></li>
<li><a href="/2010/03/09/what-make-javascript-closures-work/" rel="bookmark" title="What make JavaScript closures work?">What make JavaScript closures work? </a></li>
<li><a href="/2010/11/12/how-to-make-mp4-progressive-with-qt-faststart/" rel="bookmark" title="How to Make MP4 Progressive with qt-faststart">How to Make MP4 Progressive with qt-faststart </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/01/28/make-your-own-link-shortener/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
