Skip to content
This repository was archived by the owner on Nov 27, 2020. It is now read-only.

Commit 7658f94

Browse files
committed
minor #784 Disabled MultiViews in .htaccess (florianv)
This PR was submitted for the 2.7 branch but it was merged into the 2.3 branch instead (closes #784). Discussion ---------- Disabled MultiViews in .htaccess The `MultiViews` option enables Apache to negotiate and serve existing files depending on the request Accept header. For example `/config/test` will resolve to `/config.php/test` when accepting `text/html`. So it prevents from using route paths beginning with the name of a file present in the `/web` folder. Moreover, this option is not needed because all requests that don't match an existing file are meant to pass through the Symfony front controller. So this PR removes this option from the `.htaccess`. Note that it is enabled in the default Apache configuration on Ubuntu. This issue was also a topic here symfony/symfony-docs#3674 Commits ------- 080f0ba Disabled MultiViews in .htaccess
2 parents dc7858e + 080f0ba commit 7658f94

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

web/.htaccess

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
66
DirectoryIndex app.php
77

8+
# Disabling MultiViews prevents unwanted negotiation, e.g. "/app" should not resolve
9+
# to the front controller "/app.php" but be rewritten to "/app.php/app".
10+
<IfModule mod_negotiation.c>
11+
Options -MultiViews
12+
</IfModule>
13+
814
<IfModule mod_rewrite.c>
915
RewriteEngine On
1016

0 commit comments

Comments
 (0)