How to deploy Symfony2 on a shared-hosting?

后端 未结 2 718
广开言路
广开言路 2020-12-23 23:01

I want to access my symfony app in production env (http://www.sample.com/amateur1/web/app.php) from this url http://www.sample.com/amateur1.

To do that I moved the .

2条回答
  •  孤城傲影
    2020-12-23 23:41

    In most of the shared hosting, you can't override Apache settings in that case may need to wright a redirection rule in .htaccess file

    Options +FollowSymLinks +ExecCGI
    
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^(www\.)?mydomain\.com$ [NC]
    RewriteRule !^projectName/ /projectName/web/app.php/%{REQUEST_URI} [L,NC]
    

    this is the rule I used in my project . You may need to provide full paths to your assets other ways they will not get loaded .

提交回复
热议问题