title: How to exclude .php file from .htaccess redirect(rewriteRule)?
body: <p>I'd like to know how I can exclude a specific .php file from redirecting on a rewriteRule.</p>
  
  <p><code>site.com/images/resizer.php</code> keeps redirecting to <code>site.com/images/resizer/</code> and that's an issue as I have some headers that sets as followed ex: <code>site.com/images/resizer/?page=2</code></p>
  
  <p>In my .htaccess I have two rewrite rules that removes .php file extensions and forces slashes at the end of the url, and I'd like to exclude that resizer.php from being rewritten.</p>
  
  <pre><code>#if page with .php is requested then remove the extension
  RewriteCond %{THE_REQUEST} \s/+(.+?)\.php[\s?] [NC]
  RewriteRule ^ /%1/ [R=302,L,NE]
  
  #Force a trailing slash to be added
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{THE_REQUEST} \s/+([^.]+?[^/.])[\s?] [NC]
  RewriteRule ^ /%1/ [R=302,L]
  
  #silently rewrite to webroot
  RewriteCond %{REQUEST_URI} !/webroot/ [NC]
  RewriteRule ^ /webroot%{REQUEST_URI} [L]
  
  #.php ext hiding
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME}.php -f
  RewriteRule ^(.+?)/?$ $1.php [L]
  </code></pre>
  
  <p>I'd like resizer to be as followed: <code>site.com/images/resizer.php?page=2</code></p>
  
  <p>I tried adding the following under both the slash and .php hide extension rule but it did not work, I'm completely stuck with this..</p>
  
  <h2>failed attempts (under both rewriteRule)</h2>
  
  <pre><code>RewriteCond %{REQUEST_URI} !^/images/resizer$ [NC]
  </code></pre>
  
  <p>and</p>
  
  <pre><code>RewriteRule ^images/resizer/?$ /images/resizer.php [NC,L]
  </code></pre>