Return to Snippet

Revision: 4641
at January 14, 2008 18:27 by Abe


Updated Code
.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php [L,QSA]
# http://domain/about -> http://domain/about.php

--------------------------------------------------

.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
# http://domain/about -> http://domain/index.php?q=about

<?php
// $url_data is an array
$url_data = explode("/",$HTTP_SERVER_VARS['PATH_INFO']);
?>

Revision: 4640
at January 14, 2008 13:44 by Abe


Updated Code
.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php [L,QSA]
# http://domain/about -> http://domain/about.php

--------------------------------------------------

.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
# http://domain/about -> http://domain/index.php?q=about

Revision: 4639
at January 14, 2008 12:22 by Abe


Initial Code
.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php [L,QSA]
# http://domain/about -> http://domain/about.php

-------------------------------------------------------------------------------

.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
# http://domain/about -> http://domain/index.php?q=about

Initial URL
http://spindrop.us/2006/07/26/how-to-remove-file-extensions-from-urls/

Initial Description
You can combine them with this: http://snipplr.com/view/4848/underscore-strings/

Initial Title
Nice URLS PHP .htaccess

Initial Tags
url, php, htaccess

Initial Language
PHP