Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Using Mulpitle Domains for One Hosting Account
Old 07-13-2008, 03:44 PM Using Mulpitle Domains for One Hosting Account
Extreme Talker

Posts: 199
Trades: 0
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 www.siteA.com. The whole time the user is on the site the base URL never changes from www.siteA.com. The user needs to see 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 www.siteB.com they need go to the same hosting account and see the site as if they have no clue about 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, www.siteA.com never changes to 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
</div>
empiresolutions is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-13-2008, 06:43 PM Re: Using Mulpitle Domains for One Hosting Account
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
thats a very stange request..

surely it would be easier to have the domains as addon domains have them pointing to differant folders/directories within the account and then just have the differant sites in differant folders.

Dan
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 07-14-2008, 02:04 PM Re: Using Mulpitle Domains for One Hosting Account
Extreme Talker

Posts: 199
Trades: 0
dansgalaxy - my request is not strange. i dont want different sites. i want on site serving different code. all sites see the same database, serving "mostly" the same info.
empiresolutions is offline
Reply With Quote
View Public Profile
 
Old 07-14-2008, 05:34 PM Re: Using Mulpitle Domains for One Hosting Account
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
well surely the fact that sitea.com serves differant content from siteb.com and the fact that a user looks as sitea and siteb as differant sites?

Or are you talking like ebay.co.uk and ebay.com? for instance so same site just for differant countries.

you could always use something like a switch() based on the $_SERVER['SERVER_NAME'];

So maybe something like this:

PHP Code:
switch($_SERVER['SERVER_NAME'])
{
   case 
strpos($_SERVER['SERVER_NAME'], 'sitea.com'):
       echo 
'Your looking at www.SiteA.com';
    break;
 
   case 
strpos($_SERVER['SERVER_NAME'], 'siteb.com'):
       echo 
'Your looking at www.SiteB.com';
    break;
 
    default:
        echo 
'Not really sure which site your looking at...';
    break;

Not sure if that would work but hopefully it would.

I still personally think it might be better to have them seperated into seperate folders, and still use the same core files and db etc.

Hope this helps TP apriciated.
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Reply     « Reply to Using Mulpitle Domains for One Hosting Account
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20491 seconds with 12 queries