Hey people.. been a long while since Ive made a visit here. Anyway, on to my issue.

I'm trying to make all requests to my site be executed by a front controller. The site resides within a vhost setup as...

<VirtualHost *:80>
    DocumentRoot "/var/www/localhost/htdocs/foo"
    ServerName "foo.com"
    <Directory "/var/www/localhost/htdocs/foo">
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    <IfModule peruser.c>
        ServerEnvironment apache apache
        MinSpareProcessors 4
        MaxProcessors 20
    </IfModule>
    <IfModule itk.c>
        AssignUserID apache apache
        MaxClientsVHost 50
    </IfModule>
</VirtualHost>

My .htaccess is as follows...

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ mymvc/core/init.php/$1 [L]
</IfModule>

This partially works. If I access my site via http://foo.com/anythingatallhere my request is sent through to my front controller as I expect, and want. However, simply accessing http://foo.com or http://foo.com/ sparks an error stating I do not have permission to access / on this server. I have no index.php in the document root and directory browsing is disabled (hence the error), however, I would like all requests (including http://foo.com) to be processed via my front controller so shouldn't need an index.php page.

Anyone got any ideas?

Someone suggested removing the RewriteBase directive but that did nothing.

Thanks.

    Anyone got any ideas? Im completely stuck as to why the above doesn't work.

      Write a Reply...