Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Aug 2001 12:30:46 -0500
From:      Tony Wells <tony@camel.kdsi.net>
To:        Beech Rintoul <akbeech@anchoragerescue.org>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Apache question
Message-ID:  <3B814946.26F7B854@camel.kdsi.net>
References:  <20010819195215.C285CD3@nebula.anchoragerescue.org> <030401c12914$9c0fcb10$e4a5fea9@mark2> <20010820035919.DB399D3@nebula.anchoragerescue.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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:
> >
> > <?php
> > 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?
> 
> <?php
> if ($test=strstr($HTTP_REFERER,"http://www.alaskadesign.com/")) {
> header("Location: http://www.anchoragerescue.org/redirect.html");
> }
> ?>
> <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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B814946.26F7B854>