FallbackResource on Apache2 (2.2.22 (Ubuntu))

I am trying to clear my Apache vhosts since I have several "Alias" and all of them in mod_rewrite can be annoying. However, although I can get specific URLs (e.g. http://example.dev/robots.txt , http://example.dev/ on my own, vhost will not return to the specified URL ( FallbackResource /index.php ).

vhost is the container for the Zend Framework project, and the .htaccess files are not installed.

The access log displays .... "GET / HTTP/1.1" 302 0 , but Google Chrome shows "No data" and "Error 324 (net :: ERR_EMPTY_RESPONSE): the server closed the connection without sending any data."

Commenting out the FallbackResource line and re-enabling mod_rewrite based on <Location /> works as expected.

EDIT: There is nothing in the object that I could see that it did not work. A few lines of Alias (which FallbackResource should work with) and some FilesMatch to stop access to a file with certain extensions. The only thing that appears in the logs is 404, when it tries to go to the URL, not index.php (the specified resource).

 <VirtualHost *:80> ServerAdmin webmaster@site.com ServerName example.com ServerAlias www.example.com DocumentRoot /var/website/current/html/ SetEnv APPLICATION_ENV productionbackend # must be most specific first Alias /i/static /var/website/static/i # more /i/* Alias Alias /i /var/website/current/resources/common-furniture/ # protecting files in the directory. <FilesMatch ".*\.xml"> Order allow,deny Deny from all </FilesMatch> <Directory "/var/website/current/html/"> Options FollowSymLinks All AllowOverride All </Directory> ErrorLog logs/error.log CustomLog logs/access.log common </VirtualHost> 
+7
source share
1 answer

I have a solution. As I said in my comment on the first question, I also have the same problem. My ghost is very simple:

 <VirtualHost *:8029> DocumentRoot "C:\path\to\wwwroot" ServerName localhost <Directory /> AllowOverride All </Directory> </VirtualHost> 

and my htaccess only contains:

 FallbackResource index.html 

I added DirectoryIndex to the .htaccess file. Now it reads:

 FallbackResource /index.html DirectoryIndex index.html 

This solved the problem.

Why does it work?

An empty answer occurred only when the url / was called second and it was cached by the browser. For some reason, it seems that FallbackResource not working in this case, so I decided that, by guaranteeing that index.html would be served using DirectoryIndex , there was no need to back up. You can call it a workaround.

+3
source

All Articles