JW1980
Forum Replies Created
-
Forum: Plugins
In reply to: After W3 Total Cache redirect domain.de to www.domain.de does not work!Hi Frederick,
mschroettle has explained exactly what happens for me as well. By changing from enhanced to basic the issue was resolved, do you see the same mschroettle?
Forum: Plugins
In reply to: After W3 Total Cache redirect domain.de to www.domain.de does not work!I noticed that W3 Total Cache is doing something with the headers in enhanced mode, I now use basic mode and this seems to have solved the issue. Frederick, it would be great if you could confirm that this could be a possible solution and maybe (we/you) can make it work for enhanced caching as well?
Forum: Plugins
In reply to: After W3 Total Cache redirect domain.de to www.domain.de does not work!Frederick, I think I have found a related issue. I’m trying to fix an incompatibility with WPML that hasn’t been fixed yet.
When using different domains per language, I have the following problem.
Domains are on widgets.com and language domains are widgets.xx and xx.widgets.com, all working fine using WPML.Switching languages from each page works correctly, but on home, the translation is not correctly returned. I’ve found that it is handled by the following code in sitepress.class.php:
echo '<script type="text/javascript">var icl_lang = \''.$this->this_lang.'\';var icl_home = \''.$this->language_url().'\';</script>' . PHP_EOL;
The value is read from:
addLoadEvent(function(){ var lhid = document.createElement('input'); lhid.setAttribute('type','hidden'); lhid.setAttribute('name','lang'); lhid.setAttribute('value',icl_lang); src = document.getElementById('searchform'); if(src){ src.appendChild(lhid); src.action=icl_home; } });
Unfortunately something goes wrong.
I’ve tried to patch it with:
global $sitepress_settings; $this->this_lang = array_search('https://' . $_SERVER['HTTP_HOST'],$sitepress_settings['language_domains'])
I noticed that with W3 Total Cache on, HTTP_HOST header reported by browser (Firefox, Chrome) is correct and the domain that is really requested.
But HTTP_HOST header reported by $_SERVER[‘HTTP_HOST’] reports another domain. Usually the previous one or one that it seems to set and doesn’t want to change anymore.
I’ve disabled caching on the home but it persists, any direction you can give me where to look or want to debug together? ??
Thanks for the great plugin BTW, much appreciated!