So, I have a fallbackresource configured in Apache to send index.php requests to webroot and it seems to work, unless I call a nonexistent php file in the webroot directory. For example, if I try to get "/a.php" that does not exist, I get 404 error. But if I call "/nodir/a.php", it will send it to index.php as expected.
I searched google and read the Apache documentation for this function, but didn't find out why this is happening.
My setup Server version: Apache / 2.2.20 (Ubuntu) Using the default site with the default configuration with "FallbackResource / index.php" in the directory section
Any ideas?
I can get this working correctly using mod_rewrite with the following main lines in .htaccess, but obviously will prefer FallbackResource:
(.htaccess in webroot) RewriteEngine On RewriteCond /var/www/%{REQUEST_FILENAME} !-f RewriteCond /var/www/%{REQUEST_FILENAME} !-d RewriteRule (.*) index.php Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. GET /a.php HTTP/1.1 HOST: localhost Connection: close HTTP/1.1 200 OK Date: Sat, 31 Dec 2011 02:37:48 GMT Server: Apache/2.2.20 (Ubuntu) X-Powered-By: PHP/5.3.6-13ubuntu3.3 Vary: Accept-Encoding Content-Length: 43 Connection: close Content-Type: text/html /a.php localhost Connection closed by foreign host.
apache2
Parry
source share