   [web] I'm not enjoying working with .htaccess
  I'll make this short.I have the following in my .htaccess:RewriteRule ^(.*)$ index.php?path=$1 [NC,L]From within PHP, I echo the query string. Let's assume I visit http://localhost/this/is/a/test.For some reason, "index.php" is written to the page.However, if I change my .htaccess to the following:RewriteCond %{REQUEST_FILENAME} !-f [OR]RewriteCond %{REQUEST_FILENAME} fRewriteRule ^(.*)$ index.php?path=$1 [NC,L]..."this/is/a/test" is written to the page, which is expected.Why are these different? Why am I required to perform the ridiculous hack in my second example?   
  Your original rule doesn't have anything excluding "index.php" from being rewritten to "index.php?path=index.php".  You're currently using the L flag, which doesn't do what you may think it does.  You should try using the NS flag as well:Quote:This flag forces the rewriting engine to skip a rewriting rule if the current request is an internal sub-request. For instance, sub-requests occur internally in Apache when mod_include tries to find out information about possible directory default files (index.xxx). On sub-requests it is not always useful and even sometimes causes a failure to if the complete set of rules are applied. Use this flag to exclude some rules.Use the following rule for your decision: whenever you prefix some URLs with CGI-scripts to force them to be processed by the CGI-script, the chance is high that you will run into problems (or even overhead) on sub-requests. In these cases, use this flag.