bnomei / kirby3-fingerprint

File Method and css/js helper to add hash to files
https://forum.getkirby.com/t/kirby-3-fingerprint-asset-cachebuster/23576
MIT License
37 stars 3 forks source link

Fix .htaccess rule when disabling the query option #22

Closed raphaelokon closed 3 years ago

raphaelokon commented 4 years ago

Hi there. From what I see the regex in the .htaccess rule here does not match because of the {10}… shouldn’t this be set to {32}?

# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)\.([0-9a-z]{10})\.(js|css)$ $1.$3 [L]

Addendum: Just checked https://github.com/bnomei/kirby3-fingerprint/blob/master/classes/FingerprintFile.php#L108 and since you use md5_file(), the hash is a 32-character hexadecimal number.