0

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 ?

2
  • Are you sure you also upload .htaccess file? Commented Oct 15, 2014 at 8:49
  • Yes i have the htaccess Commented Oct 15, 2014 at 8:49

1 Answer 1

3

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>
Sign up to request clarification or add additional context in comments.

5 Comments

Oh yeah thanks ! And is there a way to don't display the app.php in the url ?
with proper configuration it should work without app.php also
Yeah, but when i display the website, i am redirected to app.php
do you have apache's mod_rewrite enabled?
Oh, it's ok now.. don't know why ^^ Thanks !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.