Symfony 2.8 vhost:www /目录而不是项目索引

时间:2017-02-20 12:55:41

标签: symfony apache2 vhosts

我在symfony 2.8.2上开始了新项目。 我添加了我的apache2站点/启用了这个vhost文件,从symfony cookbook复制:

<VirtualHost *:80>
    ServerName local.n-difference.fr
    ServerAlias local.n-difference.fr

    DocumentRoot /var/www/n-difference/web
    <Directory /var/www/n-difference/web>
        AllowOverride None
        Order Allow,Deny
        Allow from All

        <IfModule mod_rewrite.c>
            Options -MultiViews
            RewriteEngine On
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*)$ app.php [QSA,L]
        </IfModule>
    </Directory>

    # uncomment the following lines if you install assets as symlinks
    # or run into problems when compiling LESS/Sass/CoffeeScript assets
    # <Directory /var/www/project>
    #     Options FollowSymlinks
    # </Directory>

    # optionally disable the RewriteEngine for the asset directories
    # which will allow apache to simply reply with a 404 when files are
    # not found instead of passing the request into the full symfony stack
    <Directory /var/www/project/web/bundles>
        <IfModule mod_rewrite.c>
            RewriteEngine Off
        </IfModule>
    </Directory>
    ErrorLog /var/log/apache2/errors.log
</VirtualHost>

我做了sudo service apache2 restart来刷新服务器。 我使用ssh从另一台Dev PC访问该项目,当然,我在这个etc / hosts文件中添加了:

192.168.1.20 local.n-difference.fr

问题是当我尝试访问url local.n-difference.fr时,我有这个www /索引页面 enter image description here 我忘记了什么吗?

非常感谢你的帮助:) (抱歉我的英语不好)

0 个答案:

没有答案