title: Mod rewrite converting underscores to dashes affecting embedded images
body: <p>I have implemented the following code to my .htaccess file to convert all underscores to dashes.</p>
  
  <pre><code>RewriteRule ^([^_]*)_([^_]*_.*) $1-$2 [L]
  RewriteRule ^([^_]*)_([^_]*)$ /$1-$2 [L,R=301]
  </code></pre>
  
  <p>The above code works, but I come across a problem when embedding images from my /images directory.</p>
  
  <p>For instance if one of the image file names contains an underscore it fails to load correctly.</p>
  
  <p>How can I emit images and javacript file names from the above rule???</p>
  
  <p>Is there another way of doing it? </p>