Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I use "Determine the language from the browser's language settings" after moving the domain from *dev* to live this doesn't seem to work at all. I'm aware of drupal's problem of getting the browser language when the page cache is enabled and implemented:
https://drupal.org/comment/reply/339958#comment-7573597
Which tries to serve the correct page on hook_boot. This isn't working as expected even when disabling redis with ?noredis=1 & the cache/NO.txt flag.
Comments
Comment #1
muschpusch CreditAttribution: muschpusch commentedI think this could be a fix:
But which nginx file is save to use for one domain only and is not overwritten by aegir?
Comment #2
omega8cc CreditAttribution: omega8cc commentedThere is no workaround to this if you need to hit Drupal on every request. You must to (almost) disable Speed Booster (not Redis), as explained in the hint #4 at http://omega8.cc/how-to-disable-all-caching-and-aggregation-115
Comment #3
muschpusch CreditAttribution: muschpusch commentedi dont think you need to hit drupal on every request but the language can be defined as in #1 on nginx level. I'm failing due to my limited nginx knowledge
i added nginx_vhost_include.conf in post.d
I don't wanna moan but your proposed fix is renaming the site to *.dev.* which besides being ugly also denies the site to all search engines (ugly could be fixed using an alias etc). At least without visitors you won't need the caching...
Comment #4
omega8cc CreditAttribution: omega8cc commentedYou do have to hit Drupal on every request if you need to dynamically redirect requests to the correct URL.
This can't be done with custom map, because you would need to modify main server config file, patch Provision etc.
The solution is not about dev URL, please make sure to really read the hint #4 at http://omega8.cc/how-to-disable-all-caching-and-aggregation-115
Of course you could add custom Nginx config to handle redirects (but not for index.php), but you would need to use proper variables, and since there are no nested IFs available, it is better to allow Drupal to manage them, and to make it possible, simply lower Speed Booster cache to 1s - this is what .dev. in the URL does automatically, and for non-dev URLs you must do the same in the local.settings.php
Comment #5
muschpusch CreditAttribution: muschpusch commentedOk thanks a lot! This works. It's a shame to disable your caching stuff but it makes sense...
For reference:
Hint: To force lower than default Speed Booster cache TTL you could add one extra line in the local.settings.php file: header('X-Accel-Expires: 1'); and if there are still issues to debug, you could disable Speed Booster completely with this line: header('X-Accel-Expires: 0'); – but please remember that disabling Speed Booster permanently is not allowed in our hosted environment.
Comment #6
gagarine CreditAttribution: gagarine commentedThis is the code I posted on http://drupal.stackexchange.com/a/121347/1761 . I copying here because this question show up on Google, hop it help.