lucy24 - 9:32 pm on Apr 29, 2012 (gmt 0)
To be sure I've got this right:
All your pages used to be .shtml. (I'm going to have trouble with this. My eyes see "shtml" but my brain processes "https" and says "Huh? That's not an extension!" Oops.)
You still have the same pages in the same places, only now they have the .php extension.
You want to hide the extension so all the user sees is pagename-- which is the same as always, except for the extension.
Did I get that right?
So always constrain your rules as tightly as possible. If it applies only to one extension, or only to directories or only to extensionless requests, put that part in the Rule itself. That way the server won't even need to look at the condition most of the time.
There is some boilerplate on the redirect-to-rewrite two-step elsewhere in this Forum. You can search for it and you'll see the basic pattern:
RewriteCond looking at THE_REQUEST
RewriteRule to create pretty URL, ending in [R=301,L]
RewriteRule to get content from "real" page, ending in [L]