title: Htaccess rewrite - ignore rule for specific url structure
body: <p>I have a website with the following htaccess code:</p>
  
  <pre><code>RewriteEngine on
  
  #
  # Externally redirect direct client requests for index page filepaths to “/” URLs
  RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/\ ]+/)*index\.(php|html?)\ HTTP/
  RewriteRule ^(([^/]+/)*)index\.(php|html?)$ http://www.mydomain.com/$1 [R=301,L]
  #
  # Externally redirect direct client requests to remove file extensions from obsolete inbound links
  RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/\ ]+/)*([^.\ ]+\.)+(php|html?)\ HTTP
  RewriteRule ^(([^/]+/)*[^.]+)\.(php|html?)$ http://www.mydomain.com/$1 [R=301,L]
  #
  #
  
  # Externally redirect non-canonical hostname requests to canonical hostname
  RewriteCond %{HTTP_HOST} !^(www\.mydomain\.com)?$
  RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]
  #
  #
  
  # Internally rewrite URLs requested with no filetype to php scripts
  # unless the requested URL resolves to an existing directory or file.
  RewriteCond %{REQUEST_URI} !(\.[^./]+)$
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ /$1.php [L]
  </code></pre>
  
  <p>It works perfectly (for those that are wondering what it does, it forces www domain, removed .html/.php extensions and automagically redirects urls with extensions to no-extension url.)</p>
  
  <p>Now the good stuff:</p>
  
  <p>I created a dynamic page at:</p>
  
  <pre><code>www.mydomain.com/opinion?name=namehere
  </code></pre>
  
  <p>I would like this url to be rewritten and force to:</p>
  
  <pre><code>www.mydomain.com/opinion-namehere
  </code></pre>
  
  <p>I tried adding this to the above htaccess code: </p>
  
  <pre><code>RewriteRule ^opinion-([A-Za-z])$ /opinion.php?name=$1 
  </code></pre>
  
  <p>But that just gives me a "The requested URL /opinion-namehere.php was not found on this server." which makes sense because it is redirecting that url to a PHP by my original code, which does not exist.</p>
  
  <p>Is there anyway I can make this work? Maybe ignore the rule for that specific url structure (/opinion.php?name)?</p>
  
  <p>Thanks tons!</p>
  
  <p>Francisco</p>