Using Mulpitle Domains for One Hosting Account

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cesarcesar
Forum Contributor
Posts: 111
Joined: Mon Oct 18, 2004 3:28 pm

Using Mulpitle Domains for One Hosting Account

Post by cesarcesar »

Hi all,

I want to set up one hosting account and access it via multiple domain names. Each different domain name will server the user slightly different content without the user knowing about the other domains. How do i do this?

Example: User comes to my hosting account via http://www.siteA.com. The whole time the user is on the site the base URL never changes from http://www.siteA.com. The user needs to see http://www.siteA.com/page1.php as so on. (Actually i plan to use ModRewrite to alter the page name, but that comes later.) Now when another user comes to http://www.siteB.com they need go to the same hosting account and see the site as if they have no clue about http://www.siteA.com, just with some different content.

Tested: I have tried using a .htaccess Symlink, but this will not work as it just redirects like a 301. Similar with CNAME's at my registrar.

Tested: Frame Forwarding via hosting account. This doesn't work since the forwarded URL doesn't change from the base URL. Meaning, http://www.siteA.com never changes to http://www.siteA.com/page1.php. Also any links show the forwarded to's URL in the status bar.

I hope my detail in description has been enough and someone has a great suggestion for me. Thanks much.

CEsar
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Using Mulpitle Domains for One Hosting Account

Post by jaoudestudios »

Do you want 2 sites on the same hosting account under different domains and are completely different? i.e siteA.com is about cars and siteB.com is about movies

Or 2 different sites accessing the same database?
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Using Mulpitle Domains for One Hosting Account

Post by Eran »

I want to set up one hosting account and access it via multiple domain names. Each different domain name will server the user slightly different content without the user knowing about the other domains. How do i do this?
Your server's control panel should allow you to do this easily. In cPanel it is called 'parked domains', and there are probably equivalents in every control panel package.
cesarcesar
Forum Contributor
Posts: 111
Joined: Mon Oct 18, 2004 3:28 pm

Re: Using Mulpitle Domains for One Hosting Account

Post by cesarcesar »

Or 2 different sites accessing the same database?
Yes, serving "mostly" the same info.
cesarcesar
Forum Contributor
Posts: 111
Joined: Mon Oct 18, 2004 3:28 pm

Re: Using Mulpitle Domains for One Hosting Account

Post by cesarcesar »

pytrin wrote:it is called 'parked domains'
Wont this only redirect? Ie, http://www.siteB.com will reload to http://www.siteA.com?
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Using Mulpitle Domains for One Hosting Account

Post by Eran »

Not redirect, use the same IP address. You can direct them to different directories on your server
cesarcesar
Forum Contributor
Posts: 111
Joined: Mon Oct 18, 2004 3:28 pm

Re: Using Mulpitle Domains for One Hosting Account

Post by cesarcesar »

Parked/Aliasing worked. Thanks much.
Post Reply