I'm creating a small web application, which is utilizing a front controller pattern. in your area I've it setup like a virtual host, and want to configure it to get rid of the leading controller in the URL. It really works more often than not, however i can't appear to deal with only the cause of the website. for instance, when the domain is localhost, and also the user types

http://localwebapp

I get a 403 forbidden, and I would like this to redirect to my front controller too. I supposed I'm able to relabel so that it is index.php, is the fact that how this really is handled normally? It should not need to be, right?

Then, on some Web addresses, I'm seeing it being rerouted to my front controller, however the request URL is extremely strange. First, my virtual host configuration:

<VirtualHost *:80>
    ServerName localwebapp
    DocumentRoot "/Users/name/localwebapp/htdocs"

    <Directory "/Users/name/localwebpapp/htdocs">
        Options Includes FollowSymLinks  
        AllowOverride All
        Order allow,deny
        Allow from all

        <IfModule mod_rewrite.c>
            #turn on rewrite engine
            RewriteEngine on            

            #trailing slashes
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.+)/$ $1 [L,R=301]

            #rewrite anything that's not a valid file or directory to the front controller
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ /front-controller.php/$1
        </IfModule>

    </Directory>

</VirtualHost>

So, after i type a URL like:

http://localwebapp/books

it will get rerouted towards the front controller, but the need for

$url = $_SERVER['REQUEST_URI'];

is

/Users/name/localwebapp/htdocs/Users/name/localwebapp/htdocs/htdocs/books

Any help could be appreciated. I'd expect the request_uri to become just /books rather than the above mentioned.

Any help on making the URL http://localwebapp toward the leading controller could be much appreciated.