From d45b5c06096dad2a52eed6c643e81fc1275c5cef Mon Sep 17 00:00:00 2001
From: Steffen Kamper <info@sk-typo3.de>
Date: Mon, 3 May 2010 10:14:08 +0000
Subject: [PATCH] updated NEWS and advanced.htaccess for proper rewrite rule

git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7520 709f56b5-9817-0410-a4d7-c38de5d9e867
---
 NEWS.txt               | 5 ++---
 misc/advanced.htaccess | 3 +++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/NEWS.txt b/NEWS.txt
index 31436033da29..b3d53e2f3a9f 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -25,9 +25,8 @@ General
 	* Automatic version-numbers of CSS and JS files to avoid caching problems: This feature provides automatic numbering of CSS and JS files using the files modified timestamp. This way the file reference will change when a CSS or JS files is changed, and by this the browser and proxy will re-cache the file. Can be configured to include the timestamp within the the filename (before .ext) or as a parameter to the file (default).
 	  If versioning is done inside the filename (by setting $TYPO3_CONF_VARS[BE][versionNumberInFilename] to true) you need this line as the first rewrite rule in .htaccess:
 		# Rule for versioned static files (see $TYPO3_CONF_VARS[BE][versionNumberInFilename])
-		RewriteCond %{REQUEST_FILENAME} !-f
-		RewriteCond %{REQUEST_FILENAME} !-d
-		RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif)$ $1.$3 [L]
+		RewriteRule ^(.+)\.(.+\d)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]
+	  IMPORTANT: this rule has to be the very first rule to work properly, at least it has to be placed before the (^typo3...) rewrite rule
 	  Developers can use this API for versioning of files in their own backend mods, by calling t3lib_div::createVersionNumberedFilename or using the core API for including files in the page renderer class.
 
 	* CSS and JS are compressed now. This means that they are concatenated to a single file. This will reduce the count of request drastically, which ends up in faster loading and better performance.
diff --git a/misc/advanced.htaccess b/misc/advanced.htaccess
index ef23b49af5c6..252ed5e92543 100644
--- a/misc/advanced.htaccess
+++ b/misc/advanced.htaccess
@@ -68,6 +68,9 @@ RewriteEngine On
 # If you place this in httpd.conf, you cannot use this directive in any case!
 #RewriteBase /
 
+# Rule for versioned static files (see $TYPO3_CONF_VARS[BE][versionNumberInFilename])
+RewriteRule ^(.+)\.(.+\d)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]
+
 # Stop rewrite processing if we are in the typo3/ directory
 # For httpd.conf, use this line instead of the next one:
 # RewriteRule ^/TYPO3root/(typo3|t3lib|tslib|fileadmin|typo3conf|typo3temp|uploads|showpic\.php|favicon\.ico)/ - [L]
-- 
GitLab