title: website htaccess redirect conflict with wordpress
body: <p>I'm not too clued up on how htaccess file coding works, but I have got the following htaccess code in my root directory and it is responsible for redirecting from url.html to url.php:</p>
  
  <pre><code>RedirectMatch permanent ^(.*)\.htm(l?)$ $1.php 
  
  
  RewriteEngine on
  RewriteRule ^index\.htm$ index.php [NC,R]
  </code></pre>
  
  <p>This code is important because all of the file names on the website have been changed over from 'html' to 'php' and I want all bookmarks and links made prior to the change over to remain valid.</p>
  
  <p>The problem is, the above htaccess code seems to prevent the wordpress blog from opening, displaying the message "Too many redirects occurred when trying to open url".</p>
  
  <p>Clearly there is some kind of redirect loop happening, but I cannot for the life of me work out exactly what the problem is.</p>
  
  <p>In my wordpress directory (/blog) the htaccess file contains the usual for wordpress:</p>
  
  <pre><code># BEGIN WordPress
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /blog/
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /blog/index.php [L]
  &lt;/IfModule&gt;
  # END WordPress
  </code></pre>
  
  <p>When the above htaccess file is removed, the wordpress index file works fine, but because the wordpress htaccess file writes the rules for the post urls, they no longer work.</p>
  
  <p>To summarise, I think there is a conflict between the two htaccess files (first one in the root directory, second one in the /blog directory) that is creating a redirect loop.</p>
  
  <p>Any ideas as to how I might solve this will be very well received.</p>
  
  <p>Thank you all in anticipation.</p>