Solved

How to redirect a page without losing HTTP_REFERER

Posted on 1997-10-31
4
490 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
  • 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Page not loading properly 15 40
Tag input html 4 40
JQuery & CSS Tab Issues 7 29
Retrieve values of an HTML form using JQUERY 2 18
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now