Loans | Problem Mortgage | Loans | Property in Spain | Advertising
Redirecting traffic [Archive] - ZGeek

PDA

View Full Version : Redirecting traffic


Reprobate
07-06-2005, 01:28 AM
Let say I have a particular referrer who is sending hits my way. They've got a link to my site and I don't want their traffic hitting that particular page.

They are sending straight to the index.html page. Is there something in my header or in the .htacess that I could make or change so when click thru's come from that particular domain name/IP, that it will redirect to another website/webpage of my choosing?

In the first instance I'd want to specify a particular domain name/ip. And send them somewhere else.

In the second scenario which would pretty much work with the first is so lets say all traffic from .sg (Singapore) that's being sent to mydomain.com/index.html is sent to a page that's specifically made for them.

Anyone here know how I can do it? Or can point me in the right direction?

Uther Pendragon
07-06-2005, 03:33 AM
apache mod_rewrite?

Lord_Phat
07-06-2005, 11:43 AM
the following should take care of the .sg instance, you'll have to provide more specifics for the other scenario

//start .htaccess
RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://.*.sg/.*$ [NC]
RewriteRule ^/index.html /sg.html [PT]
//end .htaccess

:fag:

Reprobate
07-06-2005, 08:19 PM
Excellent work Lord Phat. We'll give it a try.

The other scenario...

The referrer is http://www.fode-me.com

Well it ain't so much me getting the hits, not yet. An online acquaintance is getting traffic from that site and it's not converting for him (he has an adult site). So rather than block them he said he'd send them my way (to http://www.asciibabes.com).

Reprobate
07-06-2005, 09:03 PM
hmmm, would it be written this way...

//start .htaccess
RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://www.fode-me.com/.*$ [NC]
RewriteRule ^/index.html http://www.asciibabes.com/ [PT]
//end .htaccess

Lord_Phat
08-06-2005, 10:32 AM
yeah, that looks about right
been a small eon since i messed with mod_rewrite :fag: