Skip to content

Instantly share code, notes, and snippets.

@skvggor
Created March 5, 2012 12:58
Show Gist options
  • Save skvggor/1978211 to your computer and use it in GitHub Desktop.
Save skvggor/1978211 to your computer and use it in GitHub Desktop.
htaccess, Cesar
##############
RewriteEngine On
RewriteCond %{REQUEST_URI} !^(.*)\.(.*)$
RewriteRule ^(.*)$ %{REQUEST_URI}.php [R]
#############
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^/]+)/$ $1.php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
$url = parse_url($_SERVER['PATH_INFO'], PHP_URL_PATH);
$url = explode(’/', $url);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment