Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Arno Welzel Newsgroups: comp.lang.php,comp.infosystems.www.servers.unix Subject: Re: HTTP headers and header() Date: Sat, 14 Jan 2012 02:40:11 +0100 Organization: A noiseless patient Spider Lines: 29 Message-ID: <4F10DCFB.1060001@arnowelzel.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Injection-Info: mx04.eternal-september.org; posting-host="LDQEG7JhwNN4wgf9ro7Ddg"; logging-data="11661"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/yD2QAy5yq1jX3nmGHwabOc/xSQLW8KgU=" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 In-Reply-To: Cancel-Lock: sha1:HysSuQ7UYoPnI9PfeIDR7Y1ARIk= Xref: x330-a1.tempe.blueboxinc.net comp.lang.php:4456 comp.infosystems.www.servers.unix:55 Sandman, 2012-01-13 21:47: > 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) This is not possible. *Either* redirect *OR* keep the location. If you don't want this, you have to set up a virtual host in Apache which acts as a proxy for example.com/user. -- Arno Welzel http://arnowelzel.de http://de-rec-fahrrad.de