Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy is my LAST rule [L] not working in apache?
    primarykey
    data
    text
    <p>Background, I'm running a Zend Framework application. Trying to squeeze the most performance out of it as possible. So I'm trying to move the rules out of .htaccess exactly to the letter per this blog post by the author of a Zend Framework book: <a href="http://www.armando.ws/2009/03/how-to-run-zend-framework-with-no-htaccess-file/" rel="nofollow noreferrer">http://www.armando.ws/2009/03/how-to-run-zend-framework-with-no-htaccess-file/</a></p> <p>So basically, in httpd.conf, I'm adding an include to conf/extra/httpd-zf.conf which contains the same thing that was in my .htaccess file and working perfectly.</p> <p>Here's the pertinent code that doesn't function right in httpd-zf.conf:</p> <pre><code>RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [L,NC] RewriteRule ^.*$ /index.php [NC,L] </code></pre> <p>Controllers work fine. The index.php is seen. But static files don't work. It errors out saying that it isn't a valid controller, so clearly it's being run through index.php. </p> <p>It's almost as if after running:</p> <pre><code>RewriteRule ^.*$ - [L,NC] </code></pre> <p>it keeps right on going. And in point of fact, Removing this line:</p> <pre><code>RewriteRule ^.*$ /index.php [NC,L] </code></pre> <p>fixes the static files, but of course breaks the rest of it.</p> <p>So basically the LAST rule is not working it seems.</p> <p>Any ideas on getting this to work correctly? </p> <p>Thank you.</p> <p><strong>UPDATE</strong></p> <p>After turning on logging (I had to hike it up to Loglevel 9), it turned out that even though removing RewriteRule ^.*$ /index.php [NC,L] allowed static files to resolve, it was NOT matching on condition RewriteCond %{REQUEST_FILENAME} -s no matter what...it just did "pass through" anyway which allowed the file to show...</p> <p>so clearly, the fact that .htaccess was on the correct path made it work where the httpd-zf.conf has the wrong path.... There must be a spot somewhere that I can tell httpd-zf.conf what my docroot path is...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload