Skip to content

Instantly share code, notes, and snippets.

@mikevalstar
Created June 21, 2011 15:36
Show Gist options
  • Save mikevalstar/1038117 to your computer and use it in GitHub Desktop.
Save mikevalstar/1038117 to your computer and use it in GitHub Desktop.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
$urlchunk = explode('/', trim($pageurl, '/'));
if(count($urlchunk) > 0 && substr($urlchunk[count($urlchunk) - 1],0,1) == '?') {
unset($urlchunk[count($urlchunk) - 1]);
if(count($urlchunk) == 0) $urlchunk[0] = '';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment