From bda61c2a1920285c080dee749c4d7caf8097fd2f Mon Sep 17 00:00:00 2001 From: Steffen Kamper <info@sk-typo3.de> Date: Mon, 3 May 2010 12:03:28 +0000 Subject: [PATCH] updated NEWS and advanced.htaccess for proper rewrite rule git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7522 709f56b5-9817-0410-a4d7-c38de5d9e867 --- NEWS.txt | 4 +++- misc/advanced.htaccess | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/NEWS.txt b/NEWS.txt index b3d53e2f3a9f..df77676a4544 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -25,7 +25,9 @@ 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]) - RewriteRule ^(.+)\.(.+\d)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L] + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + 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. diff --git a/misc/advanced.htaccess b/misc/advanced.htaccess index 252ed5e92543..8043f050f02a 100644 --- a/misc/advanced.htaccess +++ b/misc/advanced.htaccess @@ -69,7 +69,9 @@ RewriteEngine On #RewriteBase / # Rule for versioned static files (see $TYPO3_CONF_VARS[BE][versionNumberInFilename]) -RewriteRule ^(.+)\.(.+\d)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L] +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +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: -- GitLab