Re: 2 domain and one IP-address

From: Date: Fri, 08 Dec 2000 12:22:23 +0000
Subject: Re: 2 domain and one IP-address
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-29328@lists.php.net to get a copy of this message
Hello Mika, One very important thing you have remember here is the "Header" function you are using. You have to make sure that this piece of code that you are using should be the first line prior to even <html> and there shouldn't be any spaces at all before the php code start. Second, you can have the same php code inside the ".html" as well, but you have to let the system know, ".html" is same as ".php", you can check the php mailing list archive, how to do this. Sorry, I don't remember. <?php if ($HTTP_HOST=='page2.domain.com') Header("Location: http://page2.domain.com/sivu2/index.html"); ?> Hope this helps. EmDzei wrote: > Hi! > > I have two domain and both of them have same IP-address. I have get some > ..asp examble how to get info from users browser what he/she have typed on it > and they go right subdirectory. Examble is here: > > > --code begin-- > > Dim Host > > Host = Request.ServerVariables("HTTP_HOST") > > If Host = "page2.domain.com" then > > Response.Redirect("/page2/index.html") > > --code ends-- > > But. My pages are on UNIX system, not in Microsoft Windows NT or 2000. I > have get some PHP scripts but when I try to put in index.html page, Front > Page 2000 moves it to <body> tag position. I think this place is wrong > place. Here the PHP code: > > <? > if ($HTTP_HOST=='page2.domain.com') { > Header('Location: > http://page2.domain.com/sivu2/index.html'); > exit; > } > > ?> > > So, do I need to change the first page index.html to index.php or can I > check this HTTP_HOST in index.html. Where I put this code? Can there be > other HTML in same page? How about different browser. Does both of typical, > Netscape and Internet Explorer, understand this? Nowadays IE is more > popular.. I have <meta http-equiv="REFRESH" content="3; > URL=core.html"> tag > in index.html page. Is it possible think that if all is correct, user can go > 'normal' to core.html and if not, then he/she go to other page and if he/she > have typed other address/domain to her/his browser. > > -Mika > > -- > _juntunen@i.am________________________________(Vantaa/F1nland)____ > GSM +358-41 529 0284, work/home: +358-9 8870 6121/ +358-9 823 7570 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#29328) next »