I am setting up my first Silex project using Fabien’s skeleton on Github:
https://github.com/fabpot/Silex-Skeleton
For some reason I can’t create a vhost for this project, the silex project stays in a sub directory.
My directory structure looks like this:
/my/example.com/htdocs/myapp/
../src/app.php
../cache
../config
../templates
../vendor
../web/index.php
I want to access my app through the URL :
http://example.com/myapp/hello/Fabien/
I have created a .htaccess file in htdocs/myapp
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /myapp
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ web/index.php [L]
</IfModule>
Now I have urls like
http://example.com/myapp/index.php/hello/Fabien/
How can I get rid of the index.php?
You should change the
RewriteBasedirective to/myapp/web: