Open jimblue opened 5 years ago
It seems like the docs are wrong about this: The HTML files for each locale are already written to locale-subfolders inside the configured static_caching_file_path
. However, if each locale has its own subfolder inside the document root, it is necessary to tweak the redirect rule for non-primary locales in order to make it work:
RewriteCond %{DOCUMENT_ROOT}/static/%{REQUEST_URI}_%{QUERY_STRING}\.html -s
RewriteCond %{REQUEST_METHOD} GET
# The below rule works for the primary locale.
RewriteRule .* static/%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
# The below rule works for non-primary locales: The static folder is one level above now.
RewriteRule .* ../static/%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
I'm following the doc to combined full measure caching combined with localization:
With the above configuration and using Valet, the generated html files can be found:
This is a strange path for FR don't you think? It should be fr/static as previously setup in Statamic settings nope?
This is probably why the cache is rendered again and again for FR locale! So I've try to change the settings to a simple path, not an array:
Now the generated html files can be found:
/static
for EN locale/static/fr
for FR localeThat make more sens... and.... it's working!!!
Kind of strange don't you think? This is the opposite of what the doc say...
So what's wrong... The documentation or something else?