<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Wickedleaf » WebDev</title>
	
	<link>http://wickedleaf.com</link>
	<description />
	<lastBuildDate>Mon, 02 Apr 2012 05:30:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/wickedleaf/webdev" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="wickedleaf/webdev" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Creating Short URLs with WordPress</title>
		<link>http://wickedleaf.com/blog/webdev/2010/creating-short-urls-with-wordpress</link>
		<comments>http://wickedleaf.com/blog/webdev/2010/creating-short-urls-with-wordpress#comments</comments>
		<pubDate>Wed, 10 Mar 2010 07:18:14 +0000</pubDate>
		<dc:creator>Emalee</dc:creator>
				<category><![CDATA[WebDev]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://wickedleaf.com/?p=46</guid>
		<description><![CDATA[My domain is short enough, so I decided that I&#8217;d prefer to use it over services like bit.ly and ow.ly to tweet/share my posts on social networking sites. It also ends up being a bit more search engine friendly because WordPress uses 301 redirects ((See 301 Redirects and Search Engine Optimization.)), which preserves the integrity...]]></description>
			<content:encoded><![CDATA[<p>My domain is short enough, so I decided that I&#8217;d prefer to use it over services like <a href="http://bit.ly">bit.ly</a> and <a href="http://ow.ly/">ow.ly</a> to tweet/share my posts on social networking sites. It also ends up being a bit more search engine friendly because WordPress uses 301 redirects ((See <a href="http://www.theinternetdigest.net/archive/301-redirects-seo.html">301 Redirects and Search Engine Optimization</a>.)), which preserves the integrity of the original URL. However, if you&#8217;re interested in tracking the statistics of your short URLs, this method isn&#8217;t for you.</p>
<p><span id="more-46"></span></p>
<h3>Step One: Change WordPress&#8217; Default Permalink Structure</h3>
<p>By default, WordPress uses a permalink structure that looks something like <code>http://example.com/?p=00</code>; in order for this &#8220;hack&#8221; to work, you&#8217;ll need to change it to a custom structure (which is recommended for SEO purposes, anyways). I&#8217;ve changed my structure to <code>http://example.com/post-title</code>, but you can use any custom structure that you&#8217;d like.</p>
<p>At this point, if you wanted to use <code>http://example.com/?p=00</code> (where <code>00</code> is the numerical ID of the post) as your short link, you could—WordPress will automatically forward it to the post&#8217;s custom permalink.</p>
<h3>Step Two: Modify the .Htaccess File to Create Custom Short URL</h3>
<p>Open up the <code>.htaccess</code> file in WordPress&#8217; main directory. It should look something like this:</p>
<pre># BEGIN WordPress
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
&lt;/IfModule&gt;
# END WordPress</pre>
<p>Directly after the line <code>RewriteBase /</code>, add the following:</p>
<pre>RewriteRule ^s/([0-9]+)$ ?p=$1 [R=301,L]</pre>
<p>Save the file. You&#8217;ll now be able to access your posts by using the short URL <code>http://example.com/s/00</code>. If you&#8217;re not a fan of the <code>s/</code> in the URL, you can change it to almost anything. For example, using&#8230;</p>
<pre>RewriteRule ^x([0-9]+)$ ?p=$1 [R=301,L]</pre>
<p>&#8230;instead will change your short URL to <code>http://example.com/x00</code>. The only real restriction is that a non-numerical character should always prelude the ID number of the post, or problems will eventually arise with your yearly and monthly archives.</p>
]]></content:encoded>
			<wfw:commentRss>http://wickedleaf.com/blog/webdev/2010/creating-short-urls-with-wordpress/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

