0

I'm new to Symfony (Currently using Symfony 3.2) and I'm trying to Deploy a Symfony Application into production on shared hosting OVH. Everything works except one thing, website is working with url www.mydomain.com/web instead of www.mydomain.com, without /web page is showing index of/ and I dont know how to fix this. What should I do to to make this work properly?

Hosting directory with my websites looks like this:

   /
     www.firstDomain.com
     www.secondDomain.com
     ...

and my htaccess file:

<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
    RewriteRule ^(.*) - [E=BASE:%1]

    RewriteCond %{HTTP:Authorization} .
    RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]


    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    RewriteRule ^app\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]


    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ - [L]


    RewriteRule ^ %{ENV:BASE}/app.php [L]
</IfModule>

<IfModule !mod_rewrite.c>
    <IfModule mod_alias.c>

        RedirectMatch 302 ^/$ /app.php/

    </IfModule>
</IfModule>
4

1 回答 1

0

You should not put symfony directly in the www/ directory but rather at the same level, then remove the www/ directly

rm -rf www/ # be careful to save what's init before doing this.

Then you have to put a symbolic link between web and www.

ln -s website/web www

It should be working if I remember correctly how OVH's mutalisation are.

于 2017-07-17T07:55:17.373 回答