Clément Andraud
Clément Andraud

Reputation: 9269

Symfony, default use app.php

I'm trying to put online a Symfony Project on a DEbian and i have a problem.

In my host I have DocumentRoot /var/www/myproject/web/, and when I display the website on my browser, I just have a list of files (the web folder in Symfony)

I want to use by default the app.php, how can I do that ?

Upvotes: 0

Views: 334

Answers (1)

Tomasz Madeyski
Tomasz Madeyski

Reputation: 10890

This case should be handled by .htaccess file which you should have in your web directory. To make this work you need to have apache mod_rewrite enabled and have a proper configuration of your VirtualHost: you need to have AllowOverride All in your Directory directive

BTW: Your server shows list of files in directory - this is considered to be dangerous in production server. Disable it by Options -Indexes in your VirtualHost configuration.

So your VirtualHost configuration should have (this is apache 2.4 conf):

<Directory /path/to/your/web/>
    Options -Indexes +FollowSymLinks +MultiViews
    AllowOverride All
    Require all granted
</Directory>

Upvotes: 3

Related Questions