[BUGFIX] Do not process downloads of .map files in typo3/ 32/46532/2
authorMarkus Klein <markus.klein@typo3.org>
Wed, 20 Jan 2016 12:24:30 +0000 (13:24 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Mon, 8 Feb 2016 14:49:00 +0000 (15:49 +0100)
Resolves: #72832
Releases: master, 7.6
Change-Id: Ie7d4dd8c99c20c80dc8d27a970a9156ff39db1bd
Reviewed-on: https://review.typo3.org/46532
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/.htaccess

index f9ac480..bb5aa7c 100644 (file)
@@ -2,7 +2,7 @@
 
        RewriteEngine On
        # Use options from the htaccess in the main directory of the frontend in order
-       # to have versioned static files working
+       # to have versioned static files and TYPO3_CONTEXT working
        RewriteOptions inherit
 
        # Store the current location in an environment variable CWD to use
        RewriteCond $0#%{REQUEST_URI} ([^#]*)#(.*)\1$
        RewriteRule ^.*$ - [E=CWD:%2]
 
+       # Block non-existing .map files, which are requested by some browsers.
+       # We need to do that this way here, because otherwise the rewrite logic
+       # of the parent folder will redirect such a request to the typo3/index.php
+       # causing the BE (login) to be returned.
+       # This is due to the nature of 'RewriteOptions inherit', which copies the rules
+       # virtually into this file (at the end) and then the defined rules, which include
+       # 'typo3/' will not match in the context of this file.
+       RewriteRule \.map$ - [F]
+
        # Redirect install tool files
        RewriteRule ^install(\/?.*)$ %{ENV:CWD}sysext/install/Start/Install.php [R=307,L]