title: Weird behavior with .htaccess
body: <p>I'm new in rewrite rule and I encounter a little issue with my .htaccess</p>
  
  <pre><code>RewriteEngine On
  RewriteRule ^toto\.html$ /toto.php [NC,L]
  RewriteCond %{REQUEST_URI} !^/(my|your)/template\.html [NC]
  RewriteCond %{REQUEST_URI} !^/(my|your)/example\.html [NC]
  RewriteRule ^([^/]*)/([^/]*)/([^\.]*)\.html$ /$1.php?type=$2&amp;name=$3 [NC,L]
  RewriteRule ^([^/]*)/([^\.]*)\.html$ /index.php?type=$1&amp;name=$2 [L]
  RedirectMatch 404 \.(htaccess|htpasswd|ini|log|sh|inc|bak|bkp|sql|json)$
  </code></pre>
  
  <p>I tested it on <a href="https://htaccess.madewithlove.be/" rel="nofollow noreferrer">https://htaccess.madewithlove.be/</a> which always give me the right rewrite.</p>
  
  <p>When I test it on my webhosting :</p>
  
  <p>I go to <a href="http://mydomain.ovh/my/object.html" rel="nofollow noreferrer">http://mydomain.ovh/my/object.html</a></p>
  
  <p>The rewrite is <strong>right</strong> : <a href="http://mydomain.ovh/index.php?type=my&amp;name=object" rel="nofollow noreferrer">http://mydomain.ovh/index.php?type=my&amp;name=object</a></p>
  
  <p>But when I go to</p>
  
  <ul>
  <li><a href="http://mydomain.ovh/write/my/object.html" rel="nofollow noreferrer">http://mydomain.ovh/write/my/object.html</a></li>
  <li><a href="http://mydomain.ovh/extract/my/object.html" rel="nofollow noreferrer">http://mydomain.ovh/extract/my/object.html</a></li>
  <li><a href="http://mydomain.ovh/fill/your/object.html" rel="nofollow noreferrer">http://mydomain.ovh/fill/your/object.html</a></li>
  <li><a href="http://mydomain.ovh/write/your/data.html" rel="nofollow noreferrer">http://mydomain.ovh/write/your/data.html</a></li>
  <li><a href="http://mydomain.ovh/extract/your/data.html" rel="nofollow noreferrer">http://mydomain.ovh/extract/your/data.html</a></li>
  </ul>
  
  <p>The rewrite is <strong>wrong</strong> : The requested URL /redirect:.php was not found on this server.</p>
  
  <p>I don't understand this behavior...</p>
  
  <p>So I tested new rewrite rules making a common script for write/fill action :</p>
  
  <pre><code>RewriteEngine On
  RewriteRule ^toto\.html$ /toto.php [NC,L]
  RewriteCond %{REQUEST_URI} ^/extract/(my|your)/[^\.]+\.html$ [NC]
  RewriteRule ^([^/]*)/([^/]*)/([^\.]*)\.html$ /extract.php?type=$2&amp;name=$3 [L]
  RewriteCond %{REQUEST_URI} !^/extract.* [NC]
  RewriteCond %{REQUEST_URI} !^/(my|your)/template\.html [NC]
  RewriteCond %{REQUEST_URI} !^/(my|your)/example\.html [NC]
  RewriteRule ^([^/]*)/([^/]*)/([^\.]*)\.html$ /set.php?type=$2&amp;name=$3 [NC,L]
  RewriteRule ^([^/]*)/([^\.]*)\.html$ /index.php?type=$1&amp;name=$2 [L]
  RedirectMatch 404 \.(htaccess|htpasswd|ini|log|sh|inc|bak|bkp|sql|json)$
  </code></pre>
  
  <p>I tested it on <a href="https://htaccess.madewithlove.be/" rel="nofollow noreferrer">https://htaccess.madewithlove.be/</a> which always give me the right rewrite.</p>
  
  <p>And when I test it on my webhosting :</p>
  
  <p>I go to <a href="http://mydomain.ovh/my/object.html" rel="nofollow noreferrer">http://mydomain.ovh/my/object.html</a></p>
  
  <p>The rewrite is <strong>right</strong> : <a href="http://mydomain.ovh/index.php?type=my&amp;name=object" rel="nofollow noreferrer">http://mydomain.ovh/index.php?type=my&amp;name=object</a></p>
  
  <p>I go to <a href="http://mydomain.ovh/fill/my/object.html" rel="nofollow noreferrer">http://mydomain.ovh/fill/my/object.html</a> or <a href="http://mydomain.ovh/write/your/data.html" rel="nofollow noreferrer">http://mydomain.ovh/write/your/data.html</a></p>
  
  <p>The rewrite is <strong>right</strong> : <a href="http://mydomain.ovh/set.php?type=my&amp;name=object" rel="nofollow noreferrer">http://mydomain.ovh/set.php?type=my&amp;name=object</a> or <a href="http://mydomain.ovh/set.php?type=your&amp;name=data" rel="nofollow noreferrer">http://mydomain.ovh/set.php?type=your&amp;name=data</a></p>
  
  <p>But when I go to <a href="http://mydomain.ovh/extract/my/object.html" rel="nofollow noreferrer">http://mydomain.ovh/extract/my/object.html</a> or <a href="http://mydomain.ovh/extract/your/data.html" rel="nofollow noreferrer">http://mydomain.ovh/extract/your/data.html</a></p>
  
  <p>The rewrite is always <strong>wrong</strong> : the request reach the script but without query string... (and it appear to be a redirect?)</p>
  
  <pre><code>["PATH_TRANSLATED"]=&gt;
  string(19) "redirect:/index.php"
  ["PATH_INFO"]=&gt;
  string(30) "/my/object.html"
  ["SCRIPT_NAME"]=&gt;
  string(11) "/extract.php"
  ["REQUEST_URI"]=&gt;
  string(37) "/extract/my/object.html"
  ["QUERY_STRING"]=&gt;
  string(0) ""
  ["PHP_SELF"]=&gt;
  string(41) "/extract.php/my/object.html"
  </code></pre>
  
  <p>Can someone help with these rewrite rules ?</p>