|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
"http_referer"
Heya,
Im not too hot on asp, but If I wanted to redirect a visitor to a different page depending on where they came from, is this possible? heres an example: - There is a link to my site index on an DMOZ editors profile. - I want to redirect anyone that click through to my site from that page to a different page i.e. Not the index - Could I use request.servervariables("http_referer") along with some if/else statements to push that visitor elsewhere? Any assistance on this would be gravy Last edited by MrLeroy : March 31st, 2006 at 08:36 PM. |
|
#2
|
|||
|
|||
|
yes it can be done, i, however, dont know ASP so i cant give an example or guide you. Can help if you will settle for PHP
|
|
#3
|
||||
|
||||
|
Quote:
Ill settle for PhP |
|
#4
|
|||
|
|||
|
Here ya go...
Code:
<%
Dim sReferrer ' URI of referrer you want to catch
Dim sRedirectTo ' URI of page to redirect to
sReferrer = "http://whatever...etc"
sRedirectTo = "/redirect_here.html"
If Request.ServerVariables("HTTP_REFERER") = sReferrer Then
Response.Redirect(sRedirectTo)
End If
%>
Unfortunately this will not always work as some security applications (Norton for example) remove this "private" header information... Nothing you can do to get around that I'm afraid. Does it bug anyone else that they spelled referrer wrong? |
|
#5
|
||||
|
||||
|
Code:
If Request.ServerVariables("HTTP_REFERER") = sReferrer Then
Response.Redirect(sRedirectTo)
End If
%>
Should referer be spelt right there? (where i marked it red) EDITS: OH MY GOD! I cant even spell it!!! Ignore that! Also, Im guessing where you put 'sReferrer' and '(sRedirectTo)' i need to swap those for valid URLs? EDITS: Ignore this too, the penny just dropped If say I wanted to redirect 2 referrer pages, how would I go about it? Quote:
Yes, cos it doesnt half make life confusing! Last edited by MrLeroy : April 4th, 2006 at 07:39 AM. |
|
#6
|
||||
|
||||
|
Excellent, I have got it working now
Thanks ooodles, if anyone can answer my second question about multiple URL redirects please do. Thanks again |
![]() |
| Viewing: SEO Chat Forums > Other > SEO Scripts > "http_referer" |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|