title: Replace all _'s with - before query string using REGEX in .htaccess
body: <p>I'm trying create an <code>.htaccess</code> rewrite rule using regex to replace all instances of <code>_</code> with <code>-</code> in a URL prior to the <code>?</code>. The expression should not impact the query string, just the URL.</p>
  
  <p>For example, this:</p>
  
  <pre><code>/north_america/united_states/california/?search=1&amp;location=ca_orange_county&amp;city=buena_park  
  /united_states/california/?search=1&amp;location=ca_orange_county&amp;city=buena_park  
  /united_states/south_carolina/?add-place=place_name  
  /canada/british_columbia/bc/?search=1&amp;city=vancouver
  /add_listing/?listing_type=place&amp;package_id=12  
  </code></pre>
  
  <p>Would be replaced with:</p>
  
  <pre><code>/north-america/united-states/california/?search=1&amp;location=ca_orange_county&amp;city=buena_park  
  /united-states/california/?search=1&amp;location=ca_orange_county&amp;city=buena_park  
  /united-states/south-carolina/?add-place=place_name  
  /canada/british-columbia/bc/?search=1&amp;city=vancouver  
  /add-listing/?listing_type=place&amp;package_id=12  
  </code></pre>