Skip to content

Commit 2a6dc36

Browse files
committed
minor #6223 Improveme the apache/mod_php configuration example (gnat42)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #6223). Discussion ---------- Improveme the apache/mod_php configuration example We recently had a project undergo a massive security scan. We had setup email error reporting, so symfony sent us ~15K emails all mostly route not found when the scanner was playing around in the bundles asset directory. In reality if a file isn't available in the bundles directory the server can simply return a 404 not found, and it is probably also slightly more secure and performant to not fire up the entire symfony framework in that case. Commits ------- 67b661e Improvement to the apache/mod_php configuration example
2 parents 557f32d + 67b661e commit 2a6dc36

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cookbook/configuration/web_server_configuration.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ and increase web server performance:
9393
# Options FollowSymlinks
9494
# </Directory>
9595
96+
# optionally disable the RewriteEngine for the asset directories
97+
# which will allow apache to simply reply with a 404 when files are
98+
# not found instead of passing the request into the full symfony stack
99+
<Directory /var/www/project/web/bundles>
100+
<IfModule mod_rewrite.c>
101+
RewriteEngine Off
102+
</IfModule>
103+
</Directory>
96104
ErrorLog /var/log/apache2/project_error.log
97105
CustomLog /var/log/apache2/project_access.log combined
98106
</VirtualHost>

0 commit comments

Comments
 (0)