<?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>dawnerd &#187; mod_rewrite</title>
	<atom:link href="http://dawnerd.com/tag/mod_rewrite/feed/" rel="self" type="application/rss+xml" />
	<link>http://dawnerd.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Fri, 13 Aug 2010 18:20:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Quickly Creating SEO Friendly Links</title>
		<link>http://dawnerd.com/post/7_quickly-creating-seo-friendly-links/</link>
		<comments>http://dawnerd.com/post/7_quickly-creating-seo-friendly-links/#comments</comments>
		<pubDate>Fri, 09 May 2008 07:37:12 +0000</pubDate>
		<dc:creator>Troy Whiteley</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://dawnerd.com/?p=7</guid>
		<description><![CDATA[Over the years I have seen many different ways programmers have used mod_rewrite to make clean urls. However, I have not seen the correct way much. All you need in your .htaccess file is this: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} &#8230; <a href="http://dawnerd.com/post/7_quickly-creating-seo-friendly-links/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Over the years I have seen many different ways programmers have used mod_rewrite to make clean urls. However, I have not seen the correct way much. All you need in your .htaccess file is this: <span id="more-7"></span></p>
<pre>
<code markup="none">
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
</code>
</pre>
<p>that will allow you to have all the /section/production/2/view/large sections you want without creating additional rewrite conditions. In your index.php script, you can access all of the uri data by simply doing this:</p>
<pre>
<code markup="none">
$vars = explode("/",$_SERVER['REQUEST_URI']);

foreach($vars as $value)
{
     echo $value." | ";
}
</code>
</pre>
<p>That will output all of the sections in the uri. Say you want to get a product number and the uri is:</p>
<pre>
<code>
/products/12345/
</code>
</pre>
<p>Grab the product number by getting the second key in the <code>$vars</code> array.</p>
<p>This concept is used in some major open source projects such as <a href="http://wordpress.org">WordPress</a> and <a href="http://codeigniter.com">CodeIgniter</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://dawnerd.com/post/7_quickly-creating-seo-friendly-links/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
