469,289 Members | 2,273 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,289 developers. It's quick & easy.

Bilingual site with parked domain

Jacotheron
I have a problem again. I have a 2 sites for one of my customers. The site is English and Afrikaans. The English site is parked on the Afrikaans site.

The script should check to see if the page is accessed through the correct domain. If it is not accessed through the correct domain, it should redirect to the correct domain and create a cookie to always return to the correct domain.

Here is an example:

Someone enters the site through english.co.za but it shows the afrikaans.co.za's home page (afrikaans.co.za/index.html). The script should see that it is the wrong page and redirect to the page english.com/en/index.html. The cookie should remember where to go if the user enters the site again (english.co.za or afrikaans.co.za)

Can someone tell me how I am supposed to do this.
Feb 2 '08 #1
5 1448
acoder
16,027 Expert Mod 8TB
Why should it show the Afrikaans home page when accessing through the English domain?
Feb 2 '08 #2
Why should it show the Afrikaans home page when accessing through the English domain?
The English domain is parked on the Afrikaans domain. Paked domain: "Parked Domain
A Parked domain refers to a domain name that points to the same website as the domain name on which it is 'parked'. For example, you can park 'domainname.co.za' on the domain name 'domainname.com'. If someone types the parked domain name 'domainname.co.za' into a web browser, it will point to the same website that 'domainname.com' points to.

The web browser's address bar will display the parked domain name and will not display the domain name on which it is parked. A Parked domain name has the same IP address as the domain name on which it is parked."



The problem is that the main home page is Arikaans in stead of English, but my client do not want the main home page English. The cookie and javascript should redirect viewers to the page according to the addressbar.
Feb 4 '08 #3
acoder
16,027 Expert Mod 8TB
Thanks for the clarification. In your code, check the location.href. If it's the English domain, redirect by setting window.location.href to the new URL.

As for setting the cookies, I assume you know how to get/set cookies. First, check that the cookie exists. If it does, redirect. If it doesn't and it matches the English domain name, set the cookie and then redirect.
Feb 4 '08 #4
Thanks for the clarification. In your code, check the location.href. If it's the English domain, redirect by setting window.location.href to the new URL.

As for setting the cookies, I assume you know how to get/set cookies. First, check that the cookie exists. If it does, redirect. If it doesn't and it matches the English domain name, set the cookie and then redirect.
Thank you, I will try this and I guess it should work.
I just do not quite know how to get/set cookies but will try to create the correct cookies with the programs I use.
Feb 5 '08 #5
acoder
16,027 Expert Mod 8TB
I just do not quite know how to get/set cookies...
This link should help.
Feb 5 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

10 posts views Thread by Amittai Aviram | last post: by
30 posts views Thread by Gustaf Liljegren | last post: by
9 posts views Thread by dale zhang | last post: by
5 posts views Thread by will | last post: by
3 posts views Thread by jobs | last post: by
3 posts views Thread by shubby | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.