File tree Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -43,24 +43,26 @@ by executing the following command:
4343 $ composer require symfony/apache-pack
4444
4545 This pack installs a ``.htaccess `` file in the ``public/ `` directory that contains
46- the rewrite rules.
46+ the rewrite rules needed to serve the Symfony application .
4747
48- .. tip ::
48+ In production servers, you should move the ``.htaccess `` rules into the main
49+ Apache configuration file to improve performance. To do so, copy the
50+ ``.htaccess `` contents inside the ``<Directory> `` configuration associated to
51+ the Symfony application ``public/ `` directory (and replace ``AllowOverride All ``
52+ by ``AllowOverride None ``):
4953
50- A performance improvement can be achieved by moving the rewrite rules from the ``.htaccess ``
51- file into the VirtualHost block of your Apache configuration (inside the ``public/ `` Directory block)
52- and then changing ``AllowOverride All `` to ``AllowOverride None `` in your VirtualHost block.
54+ .. code-block :: apache
5355
54- .. code-block :: apache
56+ <VirtualHost *:80>
57+ # ...
58+ DocumentRoot /var/www/project/public
5559
56- <VirtualHost *:80>
57- # ...
58- DocumentRoot /var/www/project/public
59- <Directory /var/www/project/public>
60- AllowOverride None
61- # Move .htaccess contents here
62- </Directory>
63- </VirtualHost>
60+ <Directory /var/www/project/public>
61+ AllowOverride None
62+
63+ # Copy .htaccess contents here
64+ </Directory>
65+ </VirtualHost>
6466
6567 Apache with mod_php/PHP-CGI
6668---------------------------
You can’t perform that action at this time.
0 commit comments