title: .htaccess rewrite rule for replace space with hyphen in a url
body: <pre><code> mysite.com/details/42/Site Title or mysite.com/details/42/Site%20Title
  </code></pre>
  
  <p>The following rewrite rule generates the above  url</p>
  
  <pre><code> RewriteEngine on
   RewriteRule ^details/([0-9]+)/?([a-zA-Z0-9_-\s]+)/?$ /detail.php?id1=$1&amp;id2=$2 
  </code></pre>
  
  <p>How can I change the url to  </p>
  
  <pre><code> mysite.com/details/42/Site-Title
  </code></pre>
  
  <p>how can I replace the spaces with hiphen(-) in this url, please help</p>