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:
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 ``):
49
53
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
53
55
54
- .. code-block :: apache
56
+ <VirtualHost *:80>
57
+ # ...
58
+ DocumentRoot /var/www/project/public
55
59
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>
64
66
65
67
Apache with mod_php/PHP-CGI
66
68
---------------------------
You can’t perform that action at this time.
0 commit comments