Bug #77098

versionNumberInFilename = '1' not working with the demo .htaccess and Apache 2.2

Added by Marco Huber about 3 years ago. Updated 12 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2016-07-14
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

If you use an Apache 2.2 and the demo .htaccess the RewriteRule to resolve the verionNumberInFilename doesn't work. It seems like this is a bug in Apache 2.2 and/or mod_rewrite which appends the absolute path to the file when it rewrites the path. Or perhaps I misunderstood the Apache documentation ;-). In the browser you simply get a 404 for the CSS/Javascript file.

To solve this problem, you could set a "RewriteBase = /" in your .htaccess. Then it works for every file, which is not in the "/typo3" folder. But if you enable debugging for the backend, the CSS and Javascript files from the "/typo3" folder can not be found because of the .htaccess in the "/typo3" folder. You have to set a "RewriteBase = /typo3/" in the .htaccess file in the "/typo3" folder.

Or you have to modify the .htaccess RewriteRule in the root folder from

RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]

to
RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ %{ENV:CWD}$1.$3 [L]

This bug doesn't happen with Apache 2.4, but i find no requirement for a specific Apache version on https://github.com/TYPO3/TYPO3.CMS/blob/master/INSTALL.md.

This bug appears in TYPO3 6.2 and 7.6. And I think (but have not tested it) it appears in 8.x, too.

Associated revisions

Revision b34328ab (diff)
Added by Marco Huber about 3 years ago

[BUGFIX] Prepend current path to versionNumberInFilename RewriteRule

For Apache 2.2 the current location is needed in the RewriteRule for the
versionNumberInFilename feature.

Resolves: #77098
Releases: master, 7.6, 6.2
Change-Id: I94fea70473d7598a00cfcf8b9ed4f464661c369b
Reviewed-on: https://review.typo3.org/48975
Tested-by: Bamboo TYPO3com <>
Reviewed-by: Marco Huber <>
Tested-by: Marco Huber <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>
Reviewed-by: Wouter Wolters <>
Tested-by: Wouter Wolters <>

Revision 0f9b584e (diff)
Added by Marco Huber about 3 years ago

[BUGFIX] Prepend current path to versionNumberInFilename RewriteRule

For Apache 2.2 the current location is needed in the RewriteRule for the
versionNumberInFilename feature.

Resolves: #77098
Releases: master, 7.6, 6.2
Change-Id: I94fea70473d7598a00cfcf8b9ed4f464661c369b
Reviewed-on: https://review.typo3.org/49111
Reviewed-by: Wouter Wolters <>
Tested-by: Wouter Wolters <>

Revision 95c39441 (diff)
Added by Marco Huber about 3 years ago

[BUGFIX] Prepend current path to versionNumberInFilename RewriteRule

For Apache 2.2 the current location is needed in the RewriteRule for the
versionNumberInFilename feature.

Resolves: #77098
Releases: master, 7.6, 6.2
Change-Id: I94fea70473d7598a00cfcf8b9ed4f464661c369b
Reviewed-on: https://review.typo3.org/49112
Reviewed-by: Wouter Wolters <>
Tested-by: Wouter Wolters <>

History

#1 Updated by Gerrit Code Review about 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48975

#2 Updated by Gerrit Code Review about 3 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48975

#3 Updated by Gerrit Code Review about 3 years ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49111

#4 Updated by Marco Huber about 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#5 Updated by Gerrit Code Review about 3 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49112

#6 Updated by Marco Huber about 3 years ago

  • Status changed from Under Review to Resolved

#7 Updated by Benni Mack 12 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF