Results 1 to 4 of 4
Thread: redirection question
-
03-20-2004, 05:51 AM #1New Member
- Join Date
- Mar 2004
- Posts
- 2
redirection question
Hello
I'm still a newbie with redirection of domains, I would need some help:
I have a php website with 2 domains
ex:
DomainNameInEnglish.com
DomainNameInGerman.com
the content of the site is exactly the same for both but the entry page should be different according to the domain
How can I do such a thing ?
Is it possible to have an "index.php" entry page for one domain and a "index2.php" page for the other one ?
Is this something I have to do in my php code or is it a server setting ??
Thank you very much for helping
-
03-20-2004, 06:41 AM #2Disabled
- Join Date
- Jan 2004
- Posts
- 287
Redirection is not a good thing for your purpose - make mirror sites. But if you want only redirection - use <meta> or php of JavaScript.
-
03-20-2004, 06:44 AM #3Web Hosting Master
- Join Date
- Sep 2003
- Posts
- 3,857
Hi,
It depends on how you go about it and the control panel your hosting provider offers.
Generally if you have one hosting plan but have added two domains to it, then one of them will be a 'master' domain, and the other will be an add-on. The add-on will have its own folder and you would place all its files at that file. So you'll have to add a copy of all the files in that file.
The other method is to as you said before, create an index2.php, however, you'll have to set-up forwarding so the domain goes to index2.php. By default it won't go to index2.php. In CPanel, when you create an add-on domain, it will automatically create a subdomain, so the add-on domain will point to the subdomain. You can change the subdomain to point to a different location, for example index2.php.
Rameen
-
03-20-2004, 10:16 AM #4New Member
- Join Date
- Mar 2004
- Posts
- 2
Thanks for your replies
I don't really get the difference between "parked" domains, "mirror" site and "addon" domain (in cpannel settings)
I thought of doing a redirection page like this:
PHP Code:if ( location.hostname == "domain_one.com" ) {
window.location = "/users/domain_one/";
} else if ( location.hostname == "domain_two.com" ) {
window.location = "/users/domain_two/";
} else {
// build current content
}