By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,930 Members | 1,383 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,930 IT Pros & Developers. It's quick & easy.

Bilingual site with parked domain

Jacotheron
P: 44
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
Share this Question
Share on Google+
5 Replies


acoder
Expert Mod 15k+
P: 16,027
Why should it show the Afrikaans home page when accessing through the English domain?
Feb 2 '08 #2

Jacotheron
P: 44
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
Expert Mod 15k+
P: 16,027
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

Jacotheron
P: 44
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
Expert Mod 15k+
P: 16,027
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.