title: How to rewrite .php to .html using .htaccess rules?
body: <p>I tried and failed.
  Original URL</p>
  <pre><code>https://www.sitename.com/user/login/index.php
  https://www.sitename.com/user/dashboard/index.php
  </code></pre>
  <p>URL that the browser should show</p>
  <pre><code>https://www.sitename.com/user/login.html
  https://www.sitename.com/user/dashboard.html
  </code></pre>
  <p>This is what I tried and it doesnt work</p>
  <pre><code>RewriteEngine on  
  RewriteBase /
  
  RewriteCond %{THE_REQUEST} (.*)\.php  
  RewriteRule ^(.*)\.php http://%{HTTP_HOST}/user/$1.html [R=301,L]  
  
  RewriteCond %{THE_REQUEST} (.*)\.html  
  RewriteRule ^(.*)\.html http://%{HTTP_HOST}/user/$1.php [L]
  </code></pre>