Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!not-for-mail From: "M. Strobel" Newsgroups: comp.lang.php,comp.infosystems.www.servers.unix Subject: Re: HTTP headers and header() Date: Fri, 13 Jan 2012 23:33:46 +0100 Lines: 30 Message-ID: <9nbpqaF12qU2@mid.uni-berlin.de> References: <9nbpn4F12qU1@mid.uni-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 5EydMmMDDQ6/O7Whrp0BKgIWa5QpZiUdu1tSodINlsdeEk1A8= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.24) Gecko/20111101 SUSE/3.1.16 Lightning/1.0b2 Thunderbird/3.1.16 In-Reply-To: <9nbpn4F12qU1@mid.uni-berlin.de> Xref: x330-a1.tempe.blueboxinc.net comp.lang.php:4455 comp.infosystems.www.servers.unix:54 Am 13.01.2012 23:32, schrieb M. Strobel: > Am 13.01.2012 21:47, schrieb Sandman: >> Hello, >> I run a website which allows users to create profiles for >> themselves, i.e. example.com/user. Recently I've had a request for >> custom domains, i.e. where vanity.user.com would take a browser to >> example.com/user. >> >> Using my own domain, I changed vanity.user.com so it resolves to >> the IP address of my webserver. Since I run apache, I created a >> RewriteRule so if the HOST header matched vanity.user.com it would >> redirect permanently to example.com/user. >> >> Upon redirection however, the location bar in my browser updates >> to example.com/user. Does anyone know if there is a way to: >> >> 1. Redirect the vanity domain to the user's profile. >> 2. Keep the location bar the same (i.e. vanity.user.com) >> >> I'm cross-posting to comp.lang.php because I was wondering if the >> header() function might help. >> >> Thanks! >> Sandman > > Get acquainted with Apache VirtualServer and ServerName directives. > > /Str. Ops, VirtualHost