Skip to content

Commit 76847e4

Browse files
committed
Merge branch '4.4' into 5.0
* 4.4: [Server Configuration] Clarified performance tip about symfony/apache-pack
2 parents 58c09e9 + ed5bc39 commit 76847e4

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

setup/web_server_configuration.rst

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff 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
---------------------------

0 commit comments

Comments
 (0)