From owner-freebsd-questions Mon Aug 20 10:31: 8 2001 Delivered-To: freebsd-questions@freebsd.org Received: from camel.kdsi.net (camel.kdsi.net [206.103.113.218]) by hub.freebsd.org (Postfix) with ESMTP id C2F6137B410 for ; Mon, 20 Aug 2001 10:31:04 -0700 (PDT) (envelope-from tony@camel.kdsi.net) Received: from camel.kdsi.net (leepcC-108.sub-c.lee.net [208.205.126.108]) (authenticated (0 bits)) by camel.kdsi.net (8.12.0.Beta10/8.12.0.Beta10) with ESMTP id f7KHt3SW005304; Mon, 20 Aug 2001 12:55:04 -0500 (CDT) Message-ID: <3B814946.26F7B854@camel.kdsi.net> Date: Mon, 20 Aug 2001 12:30:46 -0500 From: Tony Wells X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: Beech Rintoul Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Apache question References: <20010819195215.C285CD3@nebula.anchoragerescue.org> <030401c12914$9c0fcb10$e4a5fea9@mark2> <20010820035919.DB399D3@nebula.anchoragerescue.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Beech Rintoul wrote: > > On Sunday 19 August 2001 05:08 pm, you wrote: > > > I would like to direct referrals from a specific site to a special page > > > > on > > > > > our server. Is there a way to do this? I am running the latest port of > > > apache+mod_php. > > > > With PHP you can put something like this: > > > > > if ($test=strstr($HTTP_REFERER,"http://www.example.com/")) { > > header("Location: target_url"); > > } > > ?> Check out mod_rewrite at http://httpd.apache.org. This allows for URL re-writing from .htaccess files or the httpd.conf file, and you don't have to include PHP on *every* page on your website. > > > > ....at the start of the page being linked to (or all pages on your site if > > you wish), which will put all visitors who linked from any page on > > example.com to your page identified by target_url. This must come before > > any output is sent to the browser in a HTML page (else you can no longer > > send headers). target_url can be relative or absolute. > > > > It may also be possible through your native apache config, althoguh I don't > > know how off the top of my head. > > > > Hope this helps, > > Mark > > > I tried that, but it doesn't work. Am I doing something wrong? > > if ($test=strstr($HTTP_REFERER,"http://www.alaskadesign.com/")) { > header("Location: http://www.anchoragerescue.org/redirect.html"); > } > ?> > > > Beech > > Micro$oft: "Where can we make you go today?" > ------------------------------------------------------------------- > Beech Rintoul - IT Manager - Instructor - akbeech@anchoragerescue.org > /"\ ASCII Ribbon Campaign | Anchorage Gospel Rescue Mission > \ / - NO HTML/RTF in e-mail | P.O. Box 230510 > X - NO Word docs in e-mail | Anchorage, AK 99523-0510 > / \ ----------------------------------------------------------------- > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message