4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 2 Domain names
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
kepler
Junior WebHelper
Junior WebHelper


Joined: 08 Feb 2002
Posts: 37

PostPosted: Thu Oct 23, 2003 4:47 pm (20 years, 6 months ago) Reply with QuoteBack to Top

Hi again,

I'm going to have two domain names redirected to the same webspace - they have the same IP adress. For that I've found a php script that allows the redirection of different domain names to folders. It goes like this:

<?php

$main_domain = 'maindomain.com';
$main_redirect = 'index.html';
$mix_up = "http://$main_domain/$main_redirect";
#// --------------------
#// start main script
#// --------------------
global $HTTP_HOST;
if ($HTTP_HOST == "$main_domain")
{
header("Location: ".$mix_up);
}
else {
$site = "$HTTP_HOST";
$site = strtolower($HTTP_HOST);
$site = eregi_replace("^www.", '', $site);
//$site = eregi_replace("^.", '', $site);
$site = eregi_replace("(\.)([a-z]{2,4})$", '', $site);
$redir_url = "http://$HTTP_HOST/$site/";
header("Location: ".$redir_url);
}
?>

First question: will this work? Will the two different domain names appear in the address bar with different names?

Second question: when I pass the mouse in a link, what will appear in the status bar? Adresses connected to the first or second domain name ? (probably the main - that's bad)

Is there another kind of script or configuration (in .htacess or so) that I can do to avoid problems like the above and share the two domain names in the same webspace?

Best regards,
OfflineView User's ProfileFind all posts by keplerSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Thu Oct 23, 2003 5:09 pm (20 years, 6 months ago) Reply with QuoteBack to Top

When you visit http://your_ip/, do you get your website? If so that means you have a dedicated IP and these multiple sites per account techniques should work. However it is likely that you have a shared IP (in which case when you visit the address you won't get your website), which means you won't be able to host multiple sites on the same account without redirecting visitors from the second to the first site (or using frames to keep domain2.com in the address bar).

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.209794 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme