Solved

How to redirect a page without losing HTTP_REFERER

Posted on 1997-10-31
4
537 Views
Last Modified: 2012-06-27
How can I redirect a web-browser from
one HTML page to another HTML page
without losing the environment
variable HTTP_REFERER?

Usually, if I use
<meta http-equiv=REFRESH CONTENT="1; ...">,
the environment variable HTTP_REFERER
will be gone when it gets to the second
page. So, it's not an option.

What I mean by "without losing HTTP_REFERER"
is this:

Suppose aaa.html has a pointer to bbb.html .
Now, I want those people trying to access
bbb.html to be automatically forwarded to
ccc.shtml with HTTP_REFERER still being
"aaa.html".


   That is to say,

aaa.html --1--> bbb.html ---2---> ccc.shtml

1: a link from aaa.html to bbb.html
when people follow the link,
HTTP_REFERER = aaa.html

2. automatic redirect from bbb.html
to ccc.shtml with HTTP_REFERER
still being aaa.html so I can capture
it using server side include.

 Can anybody please help me?

 Thanks in advance.
0
Comment
Question by:manchung
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Author Comment

by:manchung
ID: 1841269
Edited text of question
0
 
LVL 6

Expert Comment

by:Holger101497
ID: 1841270
My guess would be that you can't do it. That would defeat the whole purpose of HTTP-REFERRER, wouldn't it? It would be an effective cloaking device for websites and some sites that block links from certain other sites could easily be tricked.

My tip (not new): make your page bbb.html include the referrer-property as part of the link to ccc.shtml. Seeing you use shtml, I assume that you use or have access to CGI. When you generate bbb.html, encode the referrer in some way if you like (if it is not supposed to be easily changeable) and make your links point to ccc.shtml?r=rerrefer. You still can't include it with a server-side include, but ccc has access to it using either JavaScript or a CGI script that evaluates the parameters and writes it into the code for the page.

I am not saying that it is definitely not possible and leave the question open for anybody who knows a nice trick. If such a trick does not exist, my suggestion would probably be your best bet.

Unnecessary to mention that there are a dozen workarounds for your problem by adjusting the code in ccc the react to both aaa and bbb as referrers...
0
 
LVL 10

Accepted Solution

by:
kollegov earned 130 total points
ID: 1841271
Oh, Yes, I think cookie is what you need
instead of refferer.
Just set cookie in a.html and you can get in b,c, or
any other document of your site.
and you can remove cookie when user load destination
page :)
This object initially supposed to be used for this purpouses,
but not referrer.
BTW referrer not work correctly in MIE with frames. :)
0
 

Author Comment

by:manchung
ID: 1841272
Hmmmm, maybe, I was being unclear about what I really needed.

aaa.html is some webpage out there having a hyper-link to my page bbb.html. "aaa.html" is not a webpage of my own. So, I don't have  any control over it whatsoever.

My original homepage is bbb.html, which is only a plain HTML document. No java/javascript. No server side include either because my web server only executes server-side include code in documents ending with "shtml". That was why I wanted to make another webpage (ccc.html) with almost the same content as that of bbb.html except that it would carry some server-side include code to capture the HTTP_REFERRER (which is aaa.html) because I wanted to know who pointed to my webpage bbb.html.

I thought of adding some javascript in bbb.html. But, it only works when people use a javascript-enabled browser. It doesn't work under all circumstances.

Besides, I also tried to turn bbb.html into a symbolic link to ccc.shtml on UNIX. But, the server-side include still didn't get executed.

Are there any other ways to figure out who points to my webpage bbb.html?

Thanks to all who have contributed their ideas to help me solve the problem.

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question