<?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>logIt &#187; htaccess</title>
	<atom:link href="https://lakm.us/logit/tag/htaccess/feed/" rel="self" type="application/rss+xml" />
	<link>https://lakm.us/logit</link>
	<description>Log Around The Clock</description>
	<lastBuildDate>Sat, 06 Jun 2015 14:17:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>URL Shortener From Yourls (1)</title>
		<link>https://lakm.us/logit/2010/05/url-shortener-from-yourls-1/</link>
		<comments>https://lakm.us/logit/2010/05/url-shortener-from-yourls-1/#comments</comments>
		<pubDate>Tue, 04 May 2010 08:33:25 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[Web Apps]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[url-shortener]]></category>
		<category><![CDATA[web-based]]></category>

		<guid isPermaLink="false">http://xp-racy.lan/it/?p=203</guid>
		<description><![CDATA[We can self-hosted URL Shortener service. I tried open source php-based URLShort and Yourls. I later choose Yourls. Both of course based on .htaccess manipulation (mod_rewrite of Apache must be enabled). I install Yourls in side http://my.web/somedir. To make my short URL to use something like http://my.web/xGf12 instead of http://my.web/somedir/xGf12, I run the regular install [...]]]></description>
				<content:encoded><![CDATA[<p>We can self-hosted URL Shortener service. I tried open source php-based <a href="http://mavrev.org/urlshort/">URLShort</a> and <a href="http://yourls.org">Yourls</a>. I later choose Yourls.</p>
<p>Both of course based on <code>.htaccess</code> manipulation (<code>mod_rewrite</code> of Apache must be enabled). I install Yourls in side <code>http://my.web/somedir</code>. To make my short URL to use something like <code>http://my.web/xGf12</code> instead of <code>http://my.web/<strong>somedir/xGf12</strong></code>, I run the regular install with that somedir as based URL, but then create <code>.htaccess</code> in <code>http://my.web/.htaccess</code> (instead of <code>http://my.web/<strong>somedir/.htaccess</strong></code>) However, I intend to use prefix <code>x</code> for the shorten URL. Here is how the regular expression implemented:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># BEGIN YOURLS</span>
&nbsp;
RewriteEngine On
RewriteBase <span style="color: #000000; font-weight: bold;">/</span>somedir<span style="color: #000000; font-weight: bold;">/</span>
RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>REQUEST_FILENAME<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">!</span>-f
RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>REQUEST_FILENAME<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">!</span>-d
RewriteRule ^<span style="color: #7a0874; font-weight: bold;">&#40;</span>x<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-9A-Za-z<span style="color: #7a0874; font-weight: bold;">&#93;</span>+<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">/</span>?$ <span style="color: #000000; font-weight: bold;">/</span>somedir<span style="color: #000000; font-weight: bold;">/</span>yourls-go.php?<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">id</span></span>=$<span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>L<span style="color: #7a0874; font-weight: bold;">&#93;</span>
RewriteRule ^<span style="color: #7a0874; font-weight: bold;">&#40;</span>x<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-9A-Za-z<span style="color: #7a0874; font-weight: bold;">&#93;</span>+<span style="color: #7a0874; font-weight: bold;">&#41;</span>\+<span style="color: #000000; font-weight: bold;">/</span>?$ <span style="color: #000000; font-weight: bold;">/</span>somedir<span style="color: #000000; font-weight: bold;">/</span>yourls-infos.php?<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">id</span></span>=$<span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>L<span style="color: #7a0874; font-weight: bold;">&#93;</span>
RewriteRule ^<span style="color: #7a0874; font-weight: bold;">&#40;</span>x<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-9A-Za-z<span style="color: #7a0874; font-weight: bold;">&#93;</span>+<span style="color: #7a0874; font-weight: bold;">&#41;</span>\+all<span style="color: #000000; font-weight: bold;">/</span>?$ <span style="color: #000000; font-weight: bold;">/</span>somedir<span style="color: #000000; font-weight: bold;">/</span>yourls-infos.php?<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">id</span></span>=$<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #007800;">all</span>=<span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>L<span style="color: #7a0874; font-weight: bold;">&#93;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># END YOURLS</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2010/05/url-shortener-from-yourls-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
