(2013-06-19, 21:20:05)ohayo Wrote: Hi there.
I've go some strange issue with my site:
My homepage on Chrome is always displayed in english, but default lang should be polish. It works just fine in sub-pages and I can switch languages with no problem. On FF/IE/Opera homepage works normally.
I've tried changing the favicon path to root and even removing it completely but it doesn't work.
I'm using pretty urls:
%nondefaultlanguage%/%parent%/%slug%/
PHP Code:RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(en)/(.*?/)?([A-Za-z0-9-]+)/?$ index.php?id=$3&lang=$1 [QSA,L]
RewriteRule ^(en)/?$ index.php?lang=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*?/)?([A-Za-z0-9-]+)/?$ index.php?id=$2&lang=pl [QSA,L]
and homepage template looks like this:
PHP Code:<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
?><?php include('inc/doctype_'.$language.'.inc.php'); ?>
<title><?php get_site_name(); ?> / <?php get_custom_field('pagetitle'); ?></title>
<?php include('inc/fonts.inc.php'); ?>
<?php include('inc/styles.inc.php'); ?>
<?php include('inc/analytics.inc.php'); ?>
<?php include('inc/social_'.$language.'.inc.php'); ?>
</head>
<body>
<div id="container">
<?php include('inc/header.inc.php'); ?>
<!-- QUOTE -->
<div id="quote_holder">
<div class="quote">
<?php get_i18n_component('quote-1'); ?>
</div>
</div>
<!-- QUOTE END-->
<!-- WRAPPER -->
<div id="wrapper">
<div class="wrapperbg">
<div class="wrapperact">
<div class="title">
<h5><?php get_i18n_component('main-haslo'); ?></h5><div class="myButton wycena"><?php get_i18n_component('wycena'); ?></div>
</div>
<br class="clear" />
<div id="content">
<div id="realizacje">
<?php include('inc/mainfolio.inc.php'); ?>
<div class="spacer2"></div>
<?php get_i18n_component('main-qualities'); ?>
</div>
</div>
</div>
</div>
</div>
<!-- WRAPPER END -->
<?php include('inc/footer_first.inc.php'); ?>
<div id="tags">
<?php get_i18n_component('tags-1'); ?>
</div>
<?php include('inc/footer_second.inc.php'); ?>
</div>
<!-- CONTAINER END -->
</body>
</html>
For anyone interested in resolving this problem on Chrome:
Just add
PHP Code:
define('I18N_IGNORE_USER_LANGUAGE',true);
I don't know why auto language detection fails in Chrome and prevents user from changing lang on homepage. I've tested my site on two computers with different Win installed (Win7 PL, Win8 EN), Chrome set to Polish and couldn't force it to behave like other browsers.
Anyway this little change sorted out my problem and maybe will help mvlcek in pinpointing the problem.