title: Apache adds character to Request URI that isnt actually there causing false rewrite rules
body: <p>I have a website that is reachable under 2 domains. If you visit the website under my2domain.eu (example) you should always be redirected to a specific page. For that I have the following redirect in htaccess:</p>
  <pre><code>RewriteCond %{HTTP_HOST} ^www\.my2domain\.eu$ [NC]
  RewriteCond %{REQUEST_URI} !^/en/projects/my2domain.*$ [NC]
  RewriteRule ^ https://www.my2domain.eu/en/projects/my2domain [L,R=307]
  </code></pre>
  <p>If you visit <a href="https://www.my2domain.eu/en/projects/my2domain" rel="nofollow noreferrer">https://www.my2domain.eu/en/projects/my2domain</a> you end in an infinite loop though, you will always get redirected to <a href="https://www.my2domain.eu/en/projects/my2domain" rel="nofollow noreferrer">https://www.my2domain.eu/en/projects/my2domain</a>.</p>
  <p>After trying for hours I contacted my server provider which found out that Apache, when visiting <a href="https://www.my2domain.eu/en/projects/my2domain" rel="nofollow noreferrer">https://www.my2domain.eu/en/projects/my2domain</a>, finds the following input:</p>
  <pre><code>[rewrite:trace4] ... ... mod_rewrite.c(480) ... - - [www.my2domain.eu/sid#23544d0][rid#7f7c08006a60/initial] [perdir
  /home/dlrxxdcg/www.my1domain.eu] RewriteCond:
  input='/xen/projects/my2domain.eu' pattern='!^/en/projects/my2domain.eu.*$' [NC] =&gt;
  matched
  </code></pre>
  <p>Notice the <strong>/xen/</strong> instead of /en/ input altough we visit <a href="https://www.my2domain.eu/en/projects/my2domain" rel="nofollow noreferrer">https://www.my2domain.eu/en/projects/my2domain</a> and not <a href="https://www.my2domain.eu/xen/projects/my2domain" rel="nofollow noreferrer">https://www.my2domain.eu/xen/projects/my2domain</a></p>
  <p>Is this a known phenomenon? Any ideas why Apache behaves like this?</p>
  <p>This also happens in a completely blank htaccess with only these rules.</p>