title: Rewrite URL to all lower case letters and redirect some URL to home page using .htaccess file
body: <p>My problem is I want to write my own rule for <code>.htaccess</code> file. I have searched the internet, they didn't told me how to write my own specific rule. All I know is that it uses regular expressions. I have little knowledge of regex. </p>
  
  <p>What I am looking for is I have the following links </p>
  
  <pre><code>http://example.com/work/project-1 
  http://example.com/work/project-2
  </code></pre>
  
  <p>when user enter like this </p>
  
  <pre><code>http://example.com/work/PrOJect-2
  </code></pre>
  
  <p>I want them to redirect to (converting all caps to small)</p>
  
  <pre><code>http://example.com/work/project-2 
  </code></pre>
  
  <p>But when user enter like this </p>
  
  <pre><code>http://example.com/work/ 
  </code></pre>
  
  <p>or </p>
  
  <pre><code>http://example.com/work  
  </code></pre>
  
  <p>I want to redirect to home page.</p>
  
  <p>For doing so I have htaccess file 
  which have some rules like</p>
  
  <pre><code>RewriteEngine On
  RewriteRule ^work(.*)/([^/]*) work-single.php$1?slug=$2 [QSA]
  </code></pre>
  
  <p>Please help me to write these rules.</p>