aboutsummaryrefslogtreecommitdiffhomepage
path: root/web/.htaccess
diff options
context:
space:
mode:
Diffstat (limited to 'web/.htaccess')
-rw-r--r--web/.htaccess22
1 files changed, 17 insertions, 5 deletions
diff --git a/web/.htaccess b/web/.htaccess
index b52e3ae6..4dc72516 100644
--- a/web/.htaccess
+++ b/web/.htaccess
@@ -5,6 +5,18 @@
5# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl). 5# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
6DirectoryIndex app.php 6DirectoryIndex app.php
7 7
8# By default, Apache does not evaluate symbolic links if you did not enable this
9# feature in your server configuration. Uncomment the following line if you
10# install assets as symlinks or if you experience problems related to symlinks
11# when compiling LESS/Sass/CoffeScript assets.
12# Options FollowSymlinks
13
14# Disabling MultiViews prevents unwanted negotiation, e.g. "/app" should not resolve
15# to the front controller "/app.php" but be rewritten to "/app.php/app".
16<IfModule mod_negotiation.c>
17 Options -MultiViews
18</IfModule>
19
8<IfModule mod_rewrite.c> 20<IfModule mod_rewrite.c>
9 RewriteEngine On 21 RewriteEngine On
10 22
@@ -18,9 +30,9 @@ DirectoryIndex app.php
18 RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ 30 RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
19 RewriteRule ^(.*) - [E=BASE:%1] 31 RewriteRule ^(.*) - [E=BASE:%1]
20 32
21 # Sets the HTTP_AUTHORIZATION header removed by apache 33 # Sets the HTTP_AUTHORIZATION header removed by Apache
22 RewriteCond %{HTTP:Authorization} . 34 RewriteCond %{HTTP:Authorization} .
23 RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 35 RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
24 36
25 # Redirect to URI without front controller to prevent duplicate content 37 # Redirect to URI without front controller to prevent duplicate content
26 # (with and without `/app.php`). Only do this redirect on the initial 38 # (with and without `/app.php`). Only do this redirect on the initial
@@ -34,15 +46,15 @@ DirectoryIndex app.php
34 # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the 46 # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
35 # following RewriteCond (best solution) 47 # following RewriteCond (best solution)
36 RewriteCond %{ENV:REDIRECT_STATUS} ^$ 48 RewriteCond %{ENV:REDIRECT_STATUS} ^$
37 RewriteRule ^app\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L] 49 RewriteRule ^app\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
38 50
39 # If the requested filename exists, simply serve it. 51 # If the requested filename exists, simply serve it.
40 # We only want to let Apache serve files and not directories. 52 # We only want to let Apache serve files and not directories.
41 RewriteCond %{REQUEST_FILENAME} -f 53 RewriteCond %{REQUEST_FILENAME} -f
42 RewriteRule .? - [L] 54 RewriteRule ^ - [L]
43 55
44 # Rewrite all other queries to the front controller. 56 # Rewrite all other queries to the front controller.
45 RewriteRule .? %{ENV:BASE}/app.php [L] 57 RewriteRule ^ %{ENV:BASE}/app.php [L]
46</IfModule> 58</IfModule>
47 59
48<IfModule !mod_rewrite.c> 60<IfModule !mod_rewrite.c>