M
M
MFT2020-07-22 11:15:21
htaccess
MFT, 2020-07-22 11:15:21

Why doesn't the redirect rule work for .woff2 files?

Hello! I don't know much about .htaccess settings. Help, please: you need to redirect files from all ShC nested folders (there is one nesting level, i.e. there are subfolders: js, css, templates, fonts, images) to the /XLS/fnc/ directory

RewriteRule ^([a-zA-z-0-9.])/ShC/((js|css|templates|fonts|images)/([a-z.-]).(css|gif|html|js|(woff2(\?v\=4\.7\.0))))$ /XLS/fnc/$2 [QSA,L]

The rule works fine for .js, .css and images files, but doesn't redirect .woff2 files (maybe because they have parameters?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2020-07-22
@MFT

Only the path to the file gets into RewriteRule, and GET parameters should be looked for in %{QUERY_STRING}.
The search pattern can be simplified.

RewriteRule ^([a-zA-z-0-9.])/ShC/(.+)$ /XLS/fnc/$2 [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question