title: Remove ".html" from URL via .htaccess for a WordPress website
body: <h3>Background information:</h3>
  
  <p>I've searched stackoverflow for a specific solution and couldn't find one that fixed my situation. Thanks in advance for any help you can offer. Your knowledge is appreciated.</p>
  
  <p>I've decided to accept a contract to "convert" (in the client's words) a Joomla site into a WordPress site. Everything is going along smoothly, except that the Joomla site links to .html files, both in its navigation and in the content of 100+ posts.</p>
  
  <p>Instead of going through each post one-by-one and updating the links or running a SQL command to remove ".html" from URLs, I've decided to put the pressure on .htaccess, with which I am somewhat comfortable.</p>
  
  <hr>
  
  <h2>What I'm trying to do &darr;</h2>
  
  <p>In WordPress, I have custom permalinks enabled, and it is as follows: 
      /%category%/%postname%</p>
  
  <p>Here's an example of what one of the <strong>old</strong> URLs in the posts looks like:</p>
  
  <pre><code>http://the-site.com/category/the-webpage.html
  </code></pre>
  
  <p>I need the htaccess file to tell the webserver to remove the .html so the user, after visiting "<a href="http://the-site.com/the-webpage.html" rel="nofollow noreferrer">http://the-site.com/the-webpage.html</a>" is instead sent to:</p>
  
  <pre><code>http://the-site.com/category/the-webpage
  </code></pre>
  
  <p>I'm setting up the page stubs to follow the file name of the Joomla pages, so <a href="http://the-site.com/category/the-webpage" rel="nofollow noreferrer">http://the-site.com/category/the-webpage</a> will work.</p>
  
  <hr>
  
  <h2>My question:</h2>
  
  <p>Can you help me discover the solution to removing .html from the URL when someone visits the site, even if the HTML file doesn't exist on the server?</p>
  
  <hr>
  
  <p><em>Here's how the .htaccess file looked before I made changes:</em></p>
  
  <pre><code># BEGIN WordPress
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  &lt;/IfModule&gt;
  # END WordPress
  </code></pre>
  
  <p><strong>Here's the latest .htaccess file as of <em>5:35pm</em> Eastern:</strong></p>
  
  <pre><code># BEGIN WordPress
  RewriteEngine On
  RewriteBase /
  RewriteCond %{REQUEST_URI} \.html$
  RewriteRule ^(.*)\.html$ $1 [R=301,L]
  
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  # END WordPress
  </code></pre>
  
  <hr>
  
  <h2>The &uarr;latest .htaccess changes work. <a href="https://stackoverflow.com/questions/3128765/remove-html-from-url-via-htaccess-for-a-wordpress-website/3128949#3128949">Thanks Tim!</a></h2>