sergeychernyshev / .htaccess

High performance drop-in .htaccess file for your site
601 stars 89 forks source link

understand a line of .htaccess #20

Closed NGOAUAN closed 2 months ago

NGOAUAN commented 4 years ago

Hello I need your help to understand this: ^(.*).(\d+)(m\d+)?.([^.]+)$

Thanks for your help

sergeychernyshev commented 4 years ago

It is a regex that accounts for a versioned and timestamped version of the file rewriting it to point at the regular filename in order to serve the latest version - see comment here: https://github.com/sergeychernyshev/.htaccess/blob/master/.htaccess#L109-L110

If you use a different pattern for fingerprinting in your filenames, feel free to modify this regular expression.