View Single Post
Old 12-29-2009, 10:22 PM   #2 (permalink)
delayedinsanity
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

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.
delayedinsanity is offline  
Reply With Quote