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:
43
43
$ composer require symfony/apache-pack
44
44
45
45
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 .
47
47
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
49
62
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>
53
66
54
67
Apache with mod_php/PHP-CGI
55
68
---------------------------
You can’t perform that action at this time.
0 commit comments