<?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>WonderLabs &#187; PHP</title>
	<atom:link href="http://labs.wondergroup.com/category/languages/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://labs.wondergroup.com</link>
	<description></description>
	<lastBuildDate>Fri, 20 Nov 2009 19:31:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Remove &#8220;index.php&#8221; Portion of URL</title>
		<link>http://labs.wondergroup.com/languages/remove-indexphp-portion-of-url/</link>
		<comments>http://labs.wondergroup.com/languages/remove-indexphp-portion-of-url/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 14:10:35 +0000</pubDate>
		<dc:creator>jthomas</dc:creator>
				<category><![CDATA[Languages]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Quick Tips and Tricks]]></category>

		<guid isPermaLink="false">http://labs.wondergroup.com/?p=119</guid>
		<description><![CDATA[Many PHP frameworks make use of routing through one master file, typically index.php. It is easy enough, however, to write that portion of the URL out, thus achieving a more svelte and sexy address bar in the process. 
To do so just create an .htaccess file in your app&#8217;s root directory (likely next to the [...]]]></description>
			<content:encoded><![CDATA[<p>Many PHP frameworks make use of routing through one master file, typically index.php. It is easy enough, however, to write that portion of the URL out, thus achieving a more svelte and sexy address bar in the process. </p>
<p>To do so just create an .htaccess file in your app&#8217;s root directory (likely next to the index.php in question) if one doesn&#8217;t already exist (OS X folks may have to use Terminal to work with .htaccess as it will be invisible). Then drop these rules into place:</p>
<pre>
&lt;ifmodule mod_rewrite.c&gt;
	Options +FollowSymLinks
	RewriteEngine On
	RewriteBase /

	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
&lt;/ifmodule&gt;
&lt;ifmodule !mod_rewrite.c&gt;
	ErrorDocument 404 /index.php
&lt;/ifmodule&gt;
</pre>
<p>Some frameworks require that you configure the base URL of the system, so don&#8217;t forget to do that too or your app will start acting wacky after this is in place.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.wondergroup.com/languages/remove-indexphp-portion-of-url/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

