<?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>Matheus Bratfisch &#187; como fazer</title>
	<atom:link href="http://www.matbra.com/tag/como-fazer/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.matbra.com</link>
	<description>&#34;Cogito ergo sum&#34;</description>
	<lastBuildDate>Tue, 20 Dec 2011 00:03:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Statistics on your URL Shortener.</title>
		<link>http://www.matbra.com/en/2009/07/02/estatisticas-no-seu-tinyurl/</link>
		<comments>http://www.matbra.com/en/2009/07/02/estatisticas-no-seu-tinyurl/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 20:48:50 +0000</pubDate>
		<dc:creator>Matheus (X-warrior) Bratfisch</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[como fazer]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[little url]]></category>
		<category><![CDATA[programação]]></category>
		<category><![CDATA[tinyurl]]></category>

		<guid isPermaLink="false">http://www.matbra.com/?p=336</guid>
		<description><![CDATA[Hello A few weeks ago I showed you how to create your own URL-Shortener. I decide to improve it, creating a simple system to control the number of access First of all you need to add some tables to your data base: CREATE TABLE access &#40; &#160; aid INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, &#160; urls_uid [...]]]></description>
			<content:encoded><![CDATA[<p>Hello</p>
<p>A few weeks ago I showed you <a href="http://www.matbra.com/2009/05/09/criando-seu-proprio-tiny-url/">how to create your own URL-Shortener</a>. I decide to improve it, creating a simple system to control the number of access</p>
<p>First of all you need to add some tables to your data base: </p>
<div class="codesnip-container" >
<div class="sql codesnip" style="font-family:monospace;"><span class="kw1">CREATE</span> <span class="kw1">TABLE</span> access <span class="br0">&#40;</span><br />
&nbsp; aid INTEGER <span class="kw1">UNSIGNED</span> <span class="kw1">NOT</span> <span class="kw1">NULL</span> <span class="kw1">AUTO_INCREMENT</span><span class="sy0">,</span><br />
&nbsp; urls_uid INTEGER <span class="kw1">UNSIGNED</span> <span class="kw1">NOT</span> <span class="kw1">NULL</span><span class="sy0">,</span><br />
&nbsp; information_iid INTEGER <span class="kw1">UNSIGNED</span> <span class="kw1">NOT</span> <span class="kw1">NULL</span><span class="sy0">,</span><br />
&nbsp; date DATE <span class="kw1">NULL</span><span class="sy0">,</span><br />
&nbsp; <span class="kw1">PRIMARY</span> <span class="kw1">KEY</span><span class="br0">&#40;</span>aid<span class="br0">&#41;</span><span class="sy0">,</span><br />
&nbsp; <span class="kw1">INDEX</span> access_FKIndex1<span class="br0">&#40;</span>information_iid<span class="br0">&#41;</span><span class="sy0">,</span><br />
&nbsp; <span class="kw1">INDEX</span> access_FKIndex2<span class="br0">&#40;</span>urls_uid<span class="br0">&#41;</span><br />
<span class="br0">&#41;</span>;</p>
<p><span class="kw1">CREATE</span> <span class="kw1">TABLE</span> information <span class="br0">&#40;</span><br />
&nbsp; iid INTEGER <span class="kw1">UNSIGNED</span> <span class="kw1">NOT</span> <span class="kw1">NULL</span> <span class="kw1">AUTO_INCREMENT</span><span class="sy0">,</span><br />
&nbsp; ip VARCHAR<span class="br0">&#40;</span>255<span class="br0">&#41;</span> <span class="kw1">NULL</span><span class="sy0">,</span><br />
&nbsp; <span class="kw1">PRIMARY</span> <span class="kw1">KEY</span><span class="br0">&#40;</span>iid<span class="br0">&#41;</span><br />
<span class="br0">&#41;</span>;</div>
</div>
<p>After this you should do a modification in your function-little-url.php in the function take_url($url):</p>
<div class="codesnip-container" >
<div class="php codesnip" style="font-family:monospace;"><span class="kw2">function</span> take_lurl<span class="br0">&#40;</span><span class="re0">$lurl</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">global</span> <span class="re0">$link</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$q</span> <span class="sy0">=</span> <span class="st0">&quot;SELECT * FROM `urls` WHERE `unique_chars` = &#8216;&quot;</span><span class="sy0">.</span><span class="re0">$lurl</span><span class="sy0">.</span><span class="st0">&quot;&#8217;&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$r</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="re0">$q</span><span class="sy0">,</span> <span class="re0">$link</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// Realiza consulta.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><a href="http://www.php.net/mysql_num_rows"><span class="kw3">mysql_num_rows</span></a><span class="br0">&#40;</span><span class="re0">$r</span><span class="br0">&#41;</span><span class="sy0">&gt;</span>0<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">$info</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_fetch_array"><span class="kw3">mysql_fetch_array</span></a><span class="br0">&#40;</span><span class="re0">$r</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">$url</span> <span class="sy0">=</span> <span class="re0">$info</span><span class="br0">&#91;</span><span class="st0">&quot;url&quot;</span><span class="br0">&#93;</span><span class="sy0">;</span> <span class="co1">// Pega endereço real</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">$uid</span> <span class="sy0">=</span> <span class="re0">$info</span><span class="br0">&#91;</span><span class="st0">&quot;uid&quot;</span><span class="br0">&#93;</span><span class="sy0">;</span> <span class="co1">// Pega ID do endereço</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">$ip</span> <span class="sy0">=</span> <span class="re0">$_SERVER</span><span class="br0">&#91;</span><span class="st_h">&#8216;REMOTE_ADDR&#8217;</span><span class="br0">&#93;</span><span class="sy0">;</span> <span class="co1">// Pega IP do usuário</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">$qr</span> <span class="sy0">=</span> <span class="st0">&quot;select iid from `information` where ip = &#8216;&quot;</span><span class="sy0">.</span><span class="re0">$ip</span><span class="sy0">.</span><span class="st0">&quot;&#8217;&quot;</span> <span class="sy0">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">$rr</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="re0">$qr</span><span class="sy0">,</span> <span class="re0">$link</span><span class="br0">&#41;</span><span class="sy0">;</span> &nbsp;<span class="co1">// Procura se este IP já está no banco de dados</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">if</span><span class="br0">&#40;</span><a href="http://www.php.net/mysql_num_rows"><span class="kw3">mysql_num_rows</span></a><span class="br0">&#40;</span><span class="re0">$rr</span><span class="br0">&#41;</span><span class="sy0">&gt;</span><span class="nu0">0</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="co1">// Caso esteja insere somente um acesso novo proveniente deste IP</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$iid</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_result"><span class="kw3">mysql_result</span></a><span class="br0">&#40;</span><span class="re0">$rr</span><span class="sy0">,</span><span class="nu0">0</span><span class="sy0">,</span><span class="st0">&quot;iid&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="st0">&quot;INSERT INTO `access` (urls_uid,information_iid,date) values (&quot;</span><span class="sy0">.</span><span class="re0">$uid</span><span class="sy0">.</span><span class="st0">&quot;, &quot;</span><span class="sy0">.</span><span class="re0">$iid</span><span class="sy0">.</span><span class="st0">&quot;, now())&quot;</span><span class="sy0">,</span> <span class="re0">$link</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span> <span class="co1">// Caso não esteja, cria um registro com este IP e após cria um acesso.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$qr</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="st0">&quot;INSERT INTO `information` (ip) values (&#8216;&quot;</span><span class="sy0">.</span><span class="re0">$ip</span><span class="sy0">.</span><span class="st0">&quot;&#8217;)&quot;</span><span class="sy0">,</span> <span class="re0">$link</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$iid</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_insert_id"><span class="kw3">mysql_insert_id</span></a><span class="br0">&#40;</span><span class="re0">$qr</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="st0">&quot;INSERT INTO `access` (urls_uid,information_iid,date) values (&quot;</span><span class="sy0">.</span><span class="re0">$uid</span><span class="sy0">.</span><span class="st0">&quot;, &quot;</span><span class="sy0">.</span><span class="re0">$iid</span><span class="sy0">.</span><span class="st0">&quot;, now())&quot;</span><span class="sy0">,</span> <span class="re0">$link</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">echo</span> <span class="st0">&quot;Sorry, link not found!&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$url</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p>In this System there is a table with IPs that already accessed	some URL, when a URL is accessed it verify the IP, if it is on the table just create an access to this IP in the new address. Otherwise, add the IP and create the access to the address.</p>
<p><a href="http://www.matbra.com/?attachment_id=351">How to create a URL-Shortener with Statistics</a></p>
<p>Matheus</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matbra.com/en/2009/07/02/estatisticas-no-seu-tinyurl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating your own Url shortener.</title>
		<link>http://www.matbra.com/en/2009/05/09/criando-seu-proprio-tiny-url/</link>
		<comments>http://www.matbra.com/en/2009/05/09/criando-seu-proprio-tiny-url/#comments</comments>
		<pubDate>Sat, 09 May 2009 06:49:18 +0000</pubDate>
		<dc:creator>Matheus (X-warrior) Bratfisch</dc:creator>
				<category><![CDATA[Aprendendo]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[como fazer]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[little url]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[programação]]></category>
		<category><![CDATA[tinyurl]]></category>

		<guid isPermaLink="false">http://www.matbra.com/?p=221</guid>
		<description><![CDATA[Good Night, Here I will show you how to create your own url shortener. First of all you need to create a table like this: CREATE TABLE IF NOT EXISTS `urls` ( `uid` int(11) NOT NULL auto_increment, `url` text default NULL, `unique_chars` varchar(25) BINARY NOT NULL, PRIMARY KEY (`uid`), UNIQUE KEY `unique_chars` (`unique_chars`) ); This [...]]]></description>
			<content:encoded><![CDATA[<p>Good Night,</p>
<p>Here I will show you how to create your own url shortener. </p>
<p>First of all you need to create a table like this:</p>
<blockquote><p>
 CREATE TABLE IF NOT EXISTS `urls` (<br />
   `uid` int(11) NOT NULL auto_increment,<br />
   `url` text default NULL,<br />
   `unique_chars` varchar(25) BINARY NOT NULL,<br />
   PRIMARY KEY  (`uid`),<br />
   UNIQUE KEY `unique_chars` (`unique_chars`)<br />
 );  </p></blockquote>
<p><em>This code was taken from Abhise in this post &#8220;<a href="http://ad1987.blogspot.com/2008/12/create-your-own-tinyurl-with-php-and.html" target="_blank">Create your own tinyurl with php and mySQL</a>&#8221; that was my bigest reference, from it I took some functions and update other ones to be more efficient. For an example I changed the field to BINARY so it be CASE SENSITIVE (aaaa different from AAAA)</em></p>
<p>The Abhise says to create many files, I particularly, created one file with all functions where I add all the functions and just called the functions in the files. </p>
<p><span id="more-221"></span></p>
<p>We need a fucntion to connect/disconnect to mysql </p>
<blockquote><p>
error_reporting(E_ALL);<br />
$link;<br />
$config;<br />
function connect_db_lurl() {<br />
	global $link;<br />
	global $config;<br />
	$hostname = &#8220;localhost&#8221;;<br />
	$username = &#8220;USUARIO&#8221;;<br />
	$password = &#8220;SENHA&#8221;;<br />
	$dbname = &#8220;DATABASE&#8221;;<br />
	$link = mysql_connect($hostname, $username, $password);  // Conecta ao mysql.<br />
	mysql_select_db($dbname) or die(&#8220;Unknown database!&#8221;);   // Seleciona o Banco de dados.<br />
	$config["domain"] = &#8220;http://seudominio.com&#8221;;  // Define a configuração da URL inicial<br />
}</p>
<p>function close_db_lurl() {<br />
	mysql_close(); // Fecha a conexão com o banco de dados<br />
}
</p></blockquote>
<p>After this I created a function to redirect to the URL.</p>
<blockquote><p>function redirect($url) {<br />
	header(&#8220;Location:&#8221;.$url); // Redireciona para a url.<br />
}</p></blockquote>
<p>Than I used the function from Abhise to generate the char sequence. (I add some chars to elevate the number of combinations</p>
<blockquote><p>function generate_chars() {<br />
	$num_chars = 6; // Tamanho que você deseja as strings<br />
	$i = 0;<br />
	$my_keys = &#8220;123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&#8221;; // Caracteres que valem para formação de endereço<br />
	$keys_length = strlen($my_keys);<br />
	$url  = &#8220;&#8221;;<br />
	while($i<$num_chars) {  // Gera sequencia aleatoria<br />
		$rand_num = mt_rand(1, $keys_length-1);<br />
	   	$url .= $my_keys[$rand_num];<br />
		$i++;<br />
	}<br />
	return $url;<br />
}  </p></blockquote>
<p>Created a function to verify if the key is unique.</p>
<blockquote><p>function isUnique($chars)  {<br />
	global $link;<br />
	$q = &#8220;SELECT * FROM `urls` WHERE `unique_chars`=&#8217;&#8221;.$chars.&#8221;&#8216;&#8221;;<br />
	$r = mysql_query($q, $link);  // Verifica se a chave é unica.<br />
	if( mysql_num_rows($r)>0 ) {<br />
		return false;<br />
	} else {<br />
		return true;<br />
	}<br />
}  </p></blockquote>
<p>And other to verify if the URL is in DB</p>
<blockquote><p>function isThere($url) {<br />
	global $link;<br />
	$q = &#8220;SELECT * FROM `urls` WHERE `url`=&#8217;&#8221;.$url.&#8221;&#8216;&#8221;;<br />
	$r = mysql_query($q);  // Verifica se já existe a url<br />
	if(mysql_num_rows($r)>0) {<br />
		return true;<br />
	} else {<br />
		return false;<br />
	}<br />
}</p></blockquote>
<p>Function to create</p>
<blockquote><p>function create() {<br />
	global $link;<br />
	global $config;<br />
	$chars = generate_chars(); // Gera sequencia de caracteres.</p>
<p>	while(!isUnique($chars)){ // Verifica se é unico, se não for gera denovo.<br />
	  $chars = generate_chars();<br />
	}</p>
<p>	$url = $_GET["u"]; // Pega o endereço que está em ?u=endereço<br />
	$url = trim($url); // Retira espaços em branco do inicio e do fim<br />
	$url = mysql_real_escape_string($url);</p>
<p>	if(!isThere($url)) { // Caso não exista o endereço no banco.<br />
		$q = &#8220;INSERT INTO `urls` (url, unique_chars) VALUES (&#8216;&#8221;.$url.&#8221;&#8216;, &#8216;&#8221;.$chars.&#8221;&#8216;)&#8221;;<br />
		$r = mysql_query($q, $link); // Insere o endereço<br />
		if(mysql_affected_rows()) {<br />
			$q = &#8220;SELECT * FROM `urls` WHERE `url`=&#8217;&#8221;.$url.&#8221;&#8216;&#8221;;<br />
			$r = mysql_query($q);<br />
			$row = mysql_fetch_row($r);<br />
			echo $config["domain"].&#8221;/&#8221;.$row[2]; // Imprime endereço para acesso da nova url<br />
		} else {<br />
			 echo &#8220;Desculpe, problemas com o banco de dados.&#8221;;<br />
		}<br />
	} else { // Caso já exista<br />
		$q = &#8220;SELECT * FROM `urls` WHERE `url` = &#8216;&#8221;.$url.&#8221;&#8216;&#8221;;<br />
		$r = mysql_query($q); // Seleciona endereço para URL<br />
		$row = mysql_fetch_row($r);<br />
		echo $config["domain"].&#8221;/&#8221;.$row[2]; // Imprime endereço para acesso da url.<br />
 	}<br />
}</p></blockquote>
<p>Looking to the code I thought to create a function to get the url.</p>
<blockquote><p>function take_lurl($lurl) {<br />
	global $link;<br />
	$q = &#8220;SELECT url FROM `urls` WHERE `unique_chars` = &#8216;&#8221;.$lurl.&#8221;&#8216;&#8221;;<br />
	$r = mysql_query($q, $link); // Pega endereço original para tal string.<br />
	if(mysql_num_rows($r)>0) {<br />
		 $info = mysql_fetch_array($r);<br />
		 $url = $info["url"];<br />
	} else {<br />
		echo &#8220;Sorry, link not found!&#8221;;<br />
	}<br />
	return $url;<br />
}</p></blockquote>
<p>Created the file &#8220;functions-little-url.php&#8221; with these functions.</p>
<p>index.php:</p>
<blockquote><p><?<br />
ob_start(); //Inicia Buffer de saida<br />
include("functions-little-url.php");<br />
connect_db_lurl();<br />
$lurl = $_GET["u"]; //Sequencia de caracteres<br />
$url = take_lurl($lurl);<br />
redirect($url);<br />
close_db_lurl();<br />
ob_end_flush(); // Fecha buffer de saida<br />
?></p></blockquote>
<p>create.php:</p>
<blockquote><p><?<br />
include("functions-little-url.php");<br />
connect_db_lurl();<br />
create();<br />
close_db_lurl();<br />
?></p></blockquote>
<p>We need to add some lines do .htaccess and enable mod_rewrite.</p>
<blockquote><p><IfModule mod_rewrite.c><br />
RewriteEngine On<br />
RewriteRule   ^([1-9a-zA-Z]*)$ index.php\?u=$1 [L]<br />
</IfModule></p></blockquote>
<p>I did this in my system that uses wordpress (that already uses mod_rewrite) so it work a little bit different. This is my .htaccess</p>
<blockquote><p><IfModule mod_rewrite.c><br />
RewriteEngine On<br />
RewriteBase /</p>
<p>RewriteCond %{REQUEST_FILENAME} !-f # Verifica se a página acessada não é um arquivo real<br />
RewriteCond %{REQUEST_FILENAME} !-d# Verifica se a página acessada não é um diretório<br />
RewriteRule ^([A-Za-z0-9]{6})$ /lurl/index.php?u=$1 [L] # Caso coincida com a expressão regular redirecione para /lurl/index.php?u=$1 onde /lurl/ é o diretório que está os meus arquivos de tiny-url e [L] indica que é a ultima instrução a ser executada. </p>
<p># Caso não feche com a parte em cima continua nas regras &#8220;padrões&#8221; do WordPress<br />
RewriteCond %{REQUEST_FILENAME} !-f # Verifica se a página acessada não é um arquivo real<br />
RewriteCond %{REQUEST_FILENAME} !-d# Verifica se a página acessada não é um diretório<br />
RewriteRule . /index.php [L]<br />
</IfModule></p></blockquote>
<p>(my URL shortener is inside /lurl/ directory but the redirect was done in matbra.com/XXXXXXX so it redirects to /lurl/</p>
<p>To create URLs acess create.php?u=ADDRESS</p>
<p><a href="http://www.matbra.com/?attachment_id=219">URL-Shortener</a></p>
<p>If you have any problem feel free to contact me. </p>
<p>Best Regards,<br />
Matheus Bratfisch</p>
<p>References:<br />
&#8212;- &#8220;Tiny Url&#8221;:<br />
<a href="http://www.php.net" target="_blank">www.php.net</a><br />
<a href="http://www.wynia.org/wordpress/2007/05/06/making-your-own-tiny-urls-with-php/" target="_blank">Wynia.org</a><br />
<a href="http://www.htmlcenter.com/blog/make-your-own-tinyurl-service/" target="_blank">htmlCenter</a><br />
&#8212;- &#8220;Mod Rewrite&#8221;:<br />
<a href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html" target="_blank"> Apache Mod Rewrite</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.matbra.com/en/2009/05/09/criando-seu-proprio-tiny-url/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

