Re: Virtual hosts

From: Date: Tue, 20 Jun 2000 21:15:05 +0000
Subject: Re: Virtual hosts
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-2360@lists.php.net to get a copy of this message
In article <H0000aad057bdbed@MHS>, M.vanderMerwe@expro.shell.co.uk wrote: > I'm using an include in the www.real.com pages which has that site's > interface, but I want the content to display different if I link > directly into www.virtual.com > > IS there something which will let me do something like: > > switch (host) > { > case "www.virtual.com": require "first.inc"; break; > case "www.real.com": require "second.inc"; break; > } Depends on what your Web server is providing: Either it's telling PHP the difference, or it's not. Look at a file that has just <?php phpinfo();?> in it using both URLs, and see if there's a difference. If there is, you can use that. If there isn't, you'll need to get your ISP to re-configure their server to give you something distinct for the two URLs. PS Don't leave that phpinfo file laying around on your server: It tells a script-kiddie precisely which version of software you run, and that makes it a little easier for them to find script-kiddie software to break in. -- Richard Lynch | If this was worth $$$ to you, buy a CD US Customer Support Director | from one of the artists listed here: Zend Technologies USA | http://www.L-I-E.com/artists.htm http://www.zend.com | (this has nothing to do with Zend, duh!)

« previous php.general (#2360) next »