File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -43,13 +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 ``):
53+
54+ .. code-block :: apache
55+
56+ <VirtualHost *:80>
57+ # ...
58+ DocumentRoot /var/www/project/public
59+
60+ <Directory /var/www/project/public>
61+ AllowOverride None
4962
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 and then changing
52- `` AllowOverride All `` to `` AllowOverride None `` in your VirtualHost block.
63+ # Copy .htaccess contents here
64+ </Directory>
65+ </ VirtualHost>
5366
5467 Apache with mod_php/PHP-CGI
5568---------------------------
You can’t perform that action at this time.
0 commit comments