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’s root directory (likely next to the index.php in question) if one doesn’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:

<ifmodule mod_rewrite.c>
	Options +FollowSymLinks
	RewriteEngine On
	RewriteBase /

	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</ifmodule>
<ifmodule !mod_rewrite.c>
	ErrorDocument 404 /index.php
</ifmodule>

Some frameworks require that you configure the base URL of the system, so don’t forget to do that too or your app will start acting wacky after this is in place.