title: redirect and change url from html to none html htaccess
body: <p>I need to redirect domain.com/abcdef.html to domain.com/abcdef and the new url´s content should be domain.com/abcdef.html.</p>
  
  <p>I realy struggle here. I can achieve to get the content from the html shown without having the html in the url, but then both urls are available.</p>
  
  <p>When I try to achieve both I get an endlessloop and an ERR 500, but I have no clue how I can prevent this endlessloop.</p>
  
  <p>so my try one - making both urls available with the same content looks like this:</p>
  
  <pre><code>RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)\.html$ /$1 [L,R=301] 
  RewriteRule ^([^\.]+)$ $1.html [NC,L]
  </code></pre>
  
  <p>The second rule is just the same withtout the first two lines:</p>
  
  <pre><code>RewriteRule ^(.*)\.html$ /$1 [L,R=301] 
  RewriteRule ^([^\.]+)$ $1.html [NC,L]
  </code></pre>
  
  <p>resulting into an endless loop. My research only brought me to solutions for either one or for a try with the index.php. But I search for a htaccess-only solution.</p>
  
  <p>Is it possible?</p>
  
  <p><strong>EDIT:</strong> I understand why the endlessloop happens
  I request blabla.html --> rule 1 makes it to blabla and requests again, rule 2 makes it to blabla.html requests again and so on. But how can I prevent this?</p>
  
  <p><strong>EDIT 2:</strong> So I tried as suggested by starkeen, and had this:</p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{ENV_REDIRECT_STATUS} 200
  RewriteRule ^ - [L]
  RewriteBase /
  RewriteRule ^(.*)\.html$ /$1 [L,R=301] 
  RewriteRule ^([^\.]+)$ $1.html [NC,L]
  </code></pre>
  
  <p>which still lead to the endlessloop. Using it with the RewriteCond still has both available (blabla.com/content.html and blabla.com/content)</p>
  
  <p>Unfortunately it is not apache 2.4 so I couldnt try the END tag, but I try to reach my hoster and ask them if I they update it.</p>
  
  <p>Or did I get you wrong and mix something up with the htaccess?</p>
  
  <p><strong>EDIT 3:</strong> So since my code should work, but doesnt, here the whole htaccess to make sure there isn´t anything else that blocks the **** from working.</p>
  
  <pre><code>AuthName "nottellingyou" 
  AuthType Basic 
  AuthUserFile /home/www/top/secret/.htpasswd 
  AuthGroupFile /dev/null 
  require valid-user
  
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteCond %{ENV_REDIRECT_STATUS} 200
  RewriteRule ^ - [L]
  RewriteBase /
  RewriteRule ^(.*)\.html$ /$1 [L,R=301] 
  RewriteRule ^([^\.]+)$ $1.html [NC,L]
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  &lt;/IfModule&gt;
  </code></pre>