public
Created

htaccess, Cesar

  • Download Gist
.htaccess
ApacheConf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
##############
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);

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.