#106394Use of SVGs within _asset Paths resolves to 404 due to missing SVG handling in default rewrite rule
Description
When addressing an SVG file which is part of an extension’s Resources/Public/Images folder within a fluid template this results in a hash addition to the filename inside the extension’s _asset-folder.
E.g.: _assets/a7de3d8338e8a464bf8950e5191729d2/Icons/flags/de.1732119456.svg
Fluid-Code-Example:
<img width=“28” height=“19” class=“teaser__flag” loading=“lazy” src=”{f:uri.resource(path: ‘Icons/flags/{flagName}.svg’, extensionName: ‘my_extension’)}
The hash-value will be handled in the according rewrite rule that is part of the blueprint .htaccess template (vendor/typo3/cms-install/Resources/Private/FolderStructureTemplateFiles/root-htaccess)
But the SVG-type is missing in the rewrite rule (lines 304-306)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.)\.(\d)\.(php|js|css|png|jpg|gif|gz)$ %{ENV:CWD}$1.$3 [L]
Changing the rule to:
RewriteRule ^(.)\.(\d)\.(php|js|css|png|jpg|gif|svg|gz)$ %{ENV:CWD}$1.$3 [L]
allows the hash to be handled and the SVG image is displayed.
It would be good if this rule can be added to the default root-htaccess template since SVGs are more and more common.