I have this in my htaccess, now it this is for removing the .php extension. My subdomain is http://example.domain.com and each time htaccess tries to look for .php and shows up 404, I've trying to find out how to make this work as well add trailing slash http://www.domain.com/example/ when ever going to the subdir.

Your code is fine (except for the No Case flag) for adding a .php extension to an extensionless filename. Apache will add the / to give you domain names but you will also need to check for !-d for the PHP extensionless, too. If you "merely" want to add the trailing / for directories, try:

Your code is fine (except for the No Case flag) for adding a .php extension to an extensionless filename. Apache will add the / to give you domain names but you will also need to check for !-d for the PHP extensionless, too. If you "merely" want to add the trailing / for directories, try:

I see, the rules given seems to block me from my site. The above code works, but tries to add ".php" to a directory subdomain and it gives off a 404 error. As per the trailing / can it be added to files .php or the files must be created within a folder of the same name?

Rémon is (pedantically) correct as you don't want to redirect to a directory which does not exist. The code functions in the manner he described.

Your code says: If the {REQUEST_URI} is not for an existing file, add .php to the URI and serve that (REMOVE that No Case flag - URIs are case sensitive!!!). I do not know how you added a trailing / with this code.

Because your two cases are different (one is add .php file extension - to a non-file, i.e., DIRECTORY, name!?! - and the other is add a trailing / to a directory). As I had stressed in another current thread, your first step should have been to define each task for mod_rewrite, convert each of those tasks into pseudocode (to see where conflicts might exist) then into mod_rewrite code. You have skipped the first step and your results show it. Relax, think about each task in detail THEN get to coding.