0

I've been making a website using Silex, with my dispatcher and an .htaccess inside the web/ folder, with the following rules :

<IfModule mod_rewrite.c>
    Options -MultiViews

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

I have also configured Apache's virtual host with the following rules :

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.localhost
    DocumentRoot "c:/wamp/www/FarmaDubno/web"
    ServerName FarmaDubno
    ServerAlias FarmaDubno
    ErrorLog "logs/FarmaDubno-error.log"
    CustomLog "logs/FarmaDubno-access.log" common
</VirtualHost>

Now that the website is finished, I want to put it online. However, I didn't find such thing as a document root in the hosting service's parameters. So I asked them what they suggested to do, and they told me the only way was with a .htaccess redirecting to the web/ folder.

The thing is : if I put the document root outside the web/ folder, the user might be able to go to the other folders of the project (such as app/, db/ or vendor/).

Any idea ?

tchap
  • 3,412
  • 3
  • 29
  • 46
Cachwir
  • 189
  • 3
  • 12
  • 1
    Have a look at this: http://stackoverflow.com/questions/10364951/make-web-root-folder-a-sub-folder-with-htaccess – oshell Dec 18 '15 at 13:40
  • Thank you Horst Jahns ! If I need something more, related to the same issue, should I ask here or there http://stackoverflow.com/questions/10364951/make-web-root-folder-a-sub-folder-with-htaccess ? – Cachwir Dec 18 '15 at 18:51

0 Answers0