12-29-2009, 10:22 PM
|
#2 (permalink)
|
|
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
|
Give this a try,
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^\.]+)$ $1.php [NC,L]
The RewriteCond tells mod_rewrite to ensure that we're not appending the file extension to a directory. The RewriteRule looks for a string that does not already have a period in it, denoting the probability of a file extension. This can be easily modified to allow periods, but check for a three character extension, or to any variety of test situations you would prefer.
Last edited by delayedinsanity : 12-30-2009 at 02:59 AM.
|
|
|
|