mod rewrite works fine apart from for missing directory index files

Posted by j w on Server Fault See other posts from Server Fault or by j w
Published on 2010-05-13T16:21:02Z Indexed on 2010/05/13 16:25 UTC
Read the original article Hit count: 256

Filed under:
|
|

I have a legacy web site hosted on Apache. It has a number of web pages sitting in the public web root and its subfolders.

publicDocs/
directorywith_no_defaultfile/
    some-legacy-flat-page.htm
.htaccess
index.php
some-legacy-flat-page.htm

I would like to start using Zend MVC for some of the newer pages.

I have got a .htaccess mod rewrite rule working so that any request for a non-existent file is sent to be handled by the MVC bootstrap file (/index.php).

With my current set-up, the following types of requests are routed to '/index.php', the MVC bootstrap:

  • /index.php
  • /blah
  • /directorywith_no_defaultfile/bloo

The following types of request are served by old legacy (flat) pages

  • /some-legacy-flat-page.htm
  • /directorywith_no_defaultfile/some-legacy-flat-page.htm

But, when I a request a non-existent file that is a directory like these:

  • /directorywith_no_defaultfile

or

  • /directorywith_no_defaultfile/

I get an error:

Forbidden    
You don't have permission to access /directorywith_no_defaultfile/ on this server.    
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I suspect this may have something to do with the way Apache handles default files.

Do you know which Apache directives could be causing this?

© Server Fault or respective owner

Related posts about apache

Related posts about htaccess