I don't know if this is the right place (because I don't know if it's PHP-related).

I've registrered two .com-domains (the will go to two dofferent unrelated sites) which I have on the same account on the sama webhost.

When I asked my webhost about it they told me that I should use som sort of script. The reality is that I have no idea of what script (and type of script) I should use, and how it'll work.

I've also asked them if they could direct it to different webroots, but they insist that I should use a script.

Someone that have the script?

(please easy-explained, since I'm a newbie on programming)

Recommended Answers

All 3 Replies

I don't know if this is the right place (because I don't know if it's PHP-related).

I've registrered two .com-domains (the will go to two dofferent unrelated sites) which I have on the same account on the sama webhost.

When I asked my webhost about it they told me that I should use som sort of script. The reality is that I have no idea of what script (and type of script) I should use, and how it'll work.

I've also asked them if they could direct it to different webroots, but they insist that I should use a script.

Someone that have the script?

(please easy-explained, since I'm a newbie on programming)

You'll need to use .htaccess provided by Apache. Not sure of the code myself or I'd provide it.

If I were you, I will change my provider straightaway, they should provide more help or at least point you to a right direction.

Yes, you can use PHP with IF...ELSE function. However, please make sure the server support PHP.

if($_SERVER['HTTP_HOST']=="www.domain1.com") {
  include("domain1_folder/index.html");
}
else {
  include("domain2_folder/index.html");
}

Save this as index.php in the root. The content of domain1 should all store within domain1_folder and domain2 in domain2_folder.

Maybe I misunderstand the question but it seems that you could use subdomains to achieve this.....


~ Jared

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.