title: Apache htaccess multiple rewritecond
body: <p>I'm having issues in writing rewritecond in the htaccess file on my web server. If someone could help me out, it would be very helpful to me.</p>
  
  <p>What I want to accomplish is these 2 things:
  1. Redirect all requests to http: // domain.com to http: // www.domain.com
  2. Redirect/ remove the index.html part from the URL if it exists.</p>
  
  <p>My current htaccess settings are:</p>
  
  <pre><code>Options +FollowSymlinks
  RewriteEngine on
  
  RewriteCond %{http_host} ^example.com [nc]
  RewriteRule ^(.*)$ http ://www. example. com/$1 [R=301,NC]
  
  RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.html\ HTTP/
  RewriteRule ^(.*)index\.html$ [b]http :// www. example. com[/b]/$1 [R=301,L]
  </code></pre>
  
  <p>What happens is that when the URL contains index.html, it basically gives a 404 page. Not sure where the redirects are looping. Cam someone chime in to shed some light on the issue?</p>
  
  <p>Thanks in advance.</p>