I need some .htaccess code that will treat extensionless files as PHP files.
Suppose the visitors visits www.mywebsite.com/dir1/dir2/file.name, it will
www.mywebsite.com/dir1/dir2/file.name
You should have a look at Apache's Options directive, most specifically the http://httpd.apache.org/docs/2.0/content-negotiation.html option which you can include in your .htaccess file and will do just that.
Add to your .htaccess:
.htaccess
Options +MultiViews