Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-26-2011, 11:36 AM   PM User | #1
utnalove
Regular Coder

 
Join Date: Oct 2008
Location: Poland
Posts: 358
Thanks: 141
Thanked 2 Times in 2 Posts
utnalove is an unknown quantity at this point
.htaccess - if redirect from xyz.net rewrite browser language to spanish

Hello, I would like to rewrite the browser language in htaccess is it possible?

Eg:

there is the domain xyz.com and the language of the site is English;
there is the domain xyz.net that redirects to xyz.com;

If somebody enters xyz.com from a redirect of xyz.net and their browser language is English, I would like the htaccess to change/rewrite the browser language to Spanish.

Is it possible?


I'll have a plugin that translates to Spanish according to the browser language, but I want ALL users coming from xyz.net see the spanish version even if they have the browser in English.
utnalove is offline   Reply With Quote
Old 07-08-2011, 10:46 PM   PM User | #2
Cags
New Coder

 
Join Date: Jul 2011
Posts: 67
Thanks: 0
Thanked 13 Times in 13 Posts
Cags is an unknown quantity at this point
You could do this for the first hit to the site by checking the HTTP_REFERER, but as soon as they click around the site the referer would no longer be the .net address but the .com address. The only solution that springs to mind would be setting a cookie on the users machine if the refererer is the .com address and checking the cookie in your scripts. It is worth baring in mind though that there is new european legislation about the use of cookies, that could potentially make this a very dark grey area. The only other solution is to have some reference to the language stored in the url, such as using a different sub-domain etc.
Cags is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:23 PM.


Advertisement
Log in to turn off these ads.