[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How to redirect a page without losing HTTP_REFERER

Posted on 1997-10-31
4
Medium Priority
?
554 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 260 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’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

656 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