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
Solved

How to redirect a page without losing HTTP_REFERER

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

Title # Comments Views Activity
Downside of adding characters set in ASP pages 6 29
jQuery Sticky Menu 24 36
How has this flight information been added to this website? 7 31
key press alert 2 32
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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 position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

808 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