Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support versionNumberInFilename in TYPO3 nginx configuration #1030

Closed
codemonkey1988 opened this issue Aug 2, 2018 · 2 comments
Closed

Support versionNumberInFilename in TYPO3 nginx configuration #1030

codemonkey1988 opened this issue Aug 2, 2018 · 2 comments

Comments

@codemonkey1988
Copy link
Contributor

Is your feature request related to a problem? Please describe.
TYPO3 can be configured to add a version number to every asset. You need to set

['BE']['versionNumberInFilename'] = '1'
['FE']['versionNumberInFilename'] = 'embed'

in typo3conf/LocalConfiguration.php
TYPO3 generates assets like typo3temp/assets/compressed/ext-all-notheme-2eace0db537855958e1f9336373b0fff.1531244432.css
The original asset is located at typo3temp/assets/compressed/ext-all-notheme-2eace0db537855958e1f9336373b0fff.css

Describe the solution you'd like
There needs to be a nginx rule to resolve the asset paths to the correct location. The corresponding htaccess rule is

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]

Describe alternatives you've considered
The current solution is to disable these settings by setting

['BE']['versionNumberInFilename'] = '0'
['FE']['versionNumberInFilename'] = ''

Additional context
Can be reproduced in TYPO3 7, 8 and 9. Just set the described setting and call the TYPO3 backend login form. All css is missing without an additional nginx configuration because the css files can not be resolved.

@rfay
Copy link
Member

rfay commented Aug 2, 2018

Currently ddev doesn't touch LocalConfiguration.php, but creates AdditionalConfiguration.php - I assume this can be handled there?

A PR is to the AdditionalConfiguration.php is welcome on this, I'm not sure at this point I completely understand how to resolve it.

@codemonkey1988
Copy link
Contributor Author

codemonkey1988 commented Aug 2, 2018

The best solution would be to translate the given htaccess rule to nginx configuration and put it into the nginx TYPO3 config file. Then it will work either the configuration is set or not. I will try do to this, but I don't have any experience with nginx config. Maybe someone with nginx configuration knowhow can help here?

@rfay rfay changed the title Support versionNumberInFilename in TYPO3 nginx configuration Support versionNumberInFilename in TYPO3 nginx configuration, fixes #1030 Aug 3, 2018
@rfay rfay changed the title Support versionNumberInFilename in TYPO3 nginx configuration, fixes #1030 Support versionNumberInFilename in TYPO3 nginx configuration Aug 7, 2018
@rfay rfay closed this as completed in fdf6f7a Aug 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants