[non joomfish] Default language by URL

A public wish list to discuss topics, features and so on for Joom!Fish 2.0
Forum rules
Forum is locked as Joom!Fish 2.0 is feature complete. To post new feature request, please use the 2.1 Forum.

[non joomfish] Default language by URL

Postby matias on Mon May 19, 2008 9:36 pm

I have two domains, one is for the English site and one for the Finnish site.

* Finnish site should have Finnish as default language, English site English
* When you change language, domain should change (perhaps not for those users which have been logged in)

I've tried to implement this, but so far my implementation isn't working. I don't understand why.

BTW: for some reason <base href="" /> is always pointing to the first used of the two sites. Is the page cached even if cache is disabled?
matias
Contributor
 
Posts: 19
Joined: Fri May 16, 2008 8:49 pm

Re: Default language by URL

Postby ivo.apostolov on Sat May 24, 2008 2:04 pm

This is more or less a problem with the forwarding of the domain or a .htaccess solution rather than Joom!Fish one.
There is no simple way J!F to know how many domains there are, that lead to the page.
User avatar
ivo.apostolov
Contributor
 
Posts: 3248
Joined: Sat Oct 20, 2007 10:39 am
Location: Sofia

Re: Default language by URL

Postby matias on Tue May 27, 2008 9:57 pm

I've already done this, but there is something odd going on which causes the sollution not work on all situations.

You can use this for all secondary domains:

RewriteCond %{HTTP_HOST} mydomain\.com$ [NC]
RewriteCond %{HTTP_COOKIE} !jfcookie\[lang\]\= [NC]
RewriteCond %{QUERY_STRING} !^$
RewriteCond %{QUERY_STRING} !lang\=
RewriteRule ^(.*)$ $1?%{QUERY_STRING}&lang=en [E=QUERY_STRING:%{QUERY_STRING}\&lang=en,R,L]

RewriteCond %{HTTP_HOST} mydomain\.com$ [NC]
RewriteCond %{HTTP_COOKIE} !jfcookie\[lang\]\= [NC]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)$ $1?lang=en [E=QUERY_STRING:lang=en]

But for some reason the first rule does not always work without redirection.. :(
matias
Contributor
 
Posts: 19
Joined: Fri May 16, 2008 8:49 pm


Return to Wish list

Who is online

Users browsing this forum: No registered users and 3 guests