title: regex to match all .php file extensions in url except for if found in the admin section
body: <p>I need to redirect all traffic on the live site to the same URL without the .php file extension, if the .php file extension is found.  However, since this is a wordpress site, I need to exclude wp-login.php and any .php extension found in a url that has wp-admin/* within it.</p>
  
  <p>How can I accomplish this via a regex:</p>
  
  <p>Currently, this matches all .php file extensions <code>(.*).php /$1</code></p>
  
  <p>But how to exclude wp-login.php and anytime the url contains wp-admin and ends with a .php extension?</p>
  
  <p>Here's what I've tried for excluding wp-login.php, but isn't working, just not sure how to do this:
  <code>(\/)(^[wp\-login])?(.*).php /$1</code></p>
  
  <p>How to do this properly?  And also exclude the wp-admin folder in the url with any strings that end with .php?</p>
  
  <p>For example:</p>
  
  <pre><code>/testing.php - Needs to Match 
  /wp-login.php - Should not Match 
  /wp-admin/edit-post.php - Should not Match 
  /wp-admin/tools.php?page=testing.php - Should not Match 
  /product/category/testing.php - Should Match
  </code></pre>