I have a hosting with my personal project in Symfony2 installed it inside a folder "public_html
", then when I want to access to my project I have to write the next
url: "mydomian.net/myprojectSymfony/web/"
, instead of "mydomain.net
".
If I just write mydomain.net
the server shows me the directory "public_html
" with all folders inside him. How can I write my .htaccess
file to solve this problem? I tried with Redirect 301
but I don't know if the right way.
In my opinion the best approach is to configure your apache vhost as explained there: http://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html
<VirtualHost *:80>
ServerName mydomain.net
ServerAlias www.mydomain.net
DocumentRoot /var/www/myprojectSymfony/web
<Directory /var/www/myprojectSymfony/web>
AllowOverride All
Order Allow,Deny
Allow from All
</Directory>
ErrorLog /var/log/apache2/project_error.log
CustomLog /var/log/apache2/project_access.log combined
</VirtualHost>