htaccess for Symfony on Shared Hosting

2019-03-03 08:07发布

问题:

Im trying to setup a local environment that resembles shared hosting. I have copied the entire project into the htdocs directory, and thus the application does not start by default in the web directory.

For this I found these 2 references: http://oldforum.symfony-project.org/index.php/m/98117/ http://www.teamlalala.com/blog/2010/05/02/how-to-handle-symfony-on-shared-hosting/

But I have 2 doubts: 1. The .htaccess mentioned in the posts is to be added inside the WEB folder, or in the ROOT folder 2. If added to the ROOT folder, should we remove the default .HTACCESS in WEB?

thanks in advance

回答1:

You should place .htaccess file in your DOCUMENT_ROOT folder. By default in symfony it is sf_project_dir/web.