title: htaccess Redirect all pages except some not working
body: <p>I'm trying to redirect all pages on my website to the homepage, except a few. I found some solutions on stackoverflow but none of these are working so I assume there might be conflicts with the rest of my htaccess which I didn't write by myself.</p>
  
  <pre><code>RewriteEngine on
  # begin my code
  RewriteCond %{REQUEST_URI} !^/agb$
  RewriteCond %{REQUEST_URI} !^/impressum$
  RewriteCond %{REQUEST_URI} !^/datenschutzerklaerung$
  RewriteRule .* https://www.mywebsite.com [R=301,L]
  # end my code
  RewriteCond %{HTTPS} off [OR]
  RewriteCond %{HTTP_HOST} !^www
  RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$
  RewriteRule ^ https://www.%1%{REQUEST_URI} [NE,L,R]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^([^\.]+)$ $1.php [NC,L]
  
  # browser requests PHP
  RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^\ ]+)\.php
  RewriteRule ^/?(.*)\.php$ /$1 [L,R=301]
  
  # check to see if the request is for a PHP file:
  RewriteCond %{REQUEST_FILENAME}\.php -f
  RewriteRule ^/?(.*)$ /$1.php [L]
  </code></pre>
  
  <p>I have tried to write RewriteRule .* / [R=301,L]</p>
  
  <p>and I've also tried to put my code beneath the rest, but this results in a redirect loop.</p>