473,413 Members | 2,056 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

How to retreive the URL of the chosen (but non-exsisting) page after redirect?

M
Hello all,

We've got the following problem: When a visitor klicks a dead link he
ends up on a 404-page like should be. On that page there's an
opportunity to mail the webmaster (me) about the missing page. Most
visitors don't describe the link or the page they came from
(containing the dead link) so I really would like to prefill their
email with the URL of the page that seems to be missing.
All ideas are welcome...

TIA,
Marco

Nov 2 '07 #1
9 1788
rf

"M@r(o" <m.*******@lelystad.nlwrote in message
news:11*********************@19g2000hsx.googlegrou ps.com...
Hello all,

We've got the following problem: When a visitor klicks a dead link he
ends up on a 404-page like should be. On that page there's an
opportunity to mail the webmaster (me) about the missing page. Most
visitors don't describe the link or the page they came from
(containing the dead link) so I really would like to prefill their
email with the URL of the page that seems to be missing.
All ideas are welcome...
Ah, my idea is that is up to you to ensure your site has no broken
links/missing pages, not your visitors.

--
Richard.
Nov 2 '07 #2

M@r(o <m.*******@lelystad.nlwrote in
<11*********************@19g2000hsx.googlegroups.c om>:
We've got the following problem: When a visitor klicks a
dead link he ends up on a 404-page like should be. On that
page there's an opportunity to mail the webmaster (me)
about the missing page. Most visitors don't describe the
link or the page they came from (containing the dead link)
so I really would like to prefill their email with the URL
of the page that seems to be missing. All ideas are
welcome...
Perhaps I'm missing something, but I'm wondering why would
you want to do that? Wouldn't it be more correct to grep
your access logs for 404's and check Referers to see what's
causing the problem? Asking your clients to act as QA,
especially where there doesn't seem to be any need to do
that, seems a bit unprofessional to me.

In any case, an online bug report form would seem like a
better solution than asking your customers to disclose
their e-mail addresses.

--
"I can't help but wonder if you... don't know a hell of a
lot more about practically every subject than Solomon ever
did."
Nov 2 '07 #3
On Nov 2, 10:14 am, "M@r(o" <m.hoef...@lelystad.nlwrote:
Hello all,

We've got the following problem: When a visitor klicks a dead link he
ends up on a 404-page like should be. On that page there's an
opportunity to mail the webmaster (me) about the missing page. Most
visitors don't describe the link or the page they came from
(containing the dead link) so I really would like to prefill their
email with the URL of the page that seems to be missing.
All ideas are welcome...

TIA,
Marco
yeah you can use apache (if you use it) to prefill the details, or can
use php, or even javascript, but it all depends on whether the user
agent has sent the referer.

of course you could write an external javascript included on each page
of your site - since were on a js group - that parses the page for
urls, and does a HEAD using ajax, sending the results back to a page
on your site (which does exist) so you can get a database full of all
the things you need to fix!

Can you not use HTTrack (versions for linux or windows) or wget to
spider your site and find the naughty pages, assuming you dont use
javascript for all the links, (postback, spit \. )

Nov 2 '07 #4
M@r(o wrote on 02 nov 2007 in comp.lang.javascript:
We've got the following problem: When a visitor klicks a dead link he
ends up on a 404-page like should be. On that page there's an
opportunity to mail the webmaster (me) about the missing page. Most
visitors don't describe the link or the page they came from
(containing the dead link) so I really would like to prefill their
email with the URL of the page that seems to be missing.
All ideas are welcome...
Using serverside J[ava]script on a ASP platform:

Error page: <% = request.serverVariables("QUERY_STRING") %>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 2 '07 #5
On Nov 2, 2:54 pm, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
M@r(o wrote on 02 nov 2007 in comp.lang.javascript:
We've got the following problem: When a visitor klicks a dead link he
ends up on a 404-page like should be. On that page there's an
opportunity to mail the webmaster (me) about the missing page. Most
visitors don't describe the link or the page they came from
(containing the dead link) so I really would like to prefill their
email with the URL of the page that seems to be missing.
All ideas are welcome...

Using serverside J[ava]script on a ASP platform:

Error page: <% = request.serverVariables("QUERY_STRING") %>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
If you se this:
Error page: <% = request.serverVariables("QUERY_STRING") %>
make sure to filter it first to avoid XSS, and response splitting etc..

Nov 14 '07 #6
shimmyshack wrote on 15 nov 2007 in comp.lang.javascript:
On Nov 2, 2:54 pm, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
>M@r(o wrote on 02 nov 2007 in comp.lang.javascript:
We've got the following problem: When a visitor klicks a dead link he
ends up on a 404-page like should be. On that page there's an
opportunity to mail the webmaster (me) about the missing page. Most
visitors don't describe the link or the page they came from
(containing the dead link) so I really would like to prefill their
email with the URL of the page that seems to be missing.
All ideas are welcome...

Using serverside J[ava]script on a ASP platform:

Error page: <% = request.serverVariables("QUERY_STRING") %>
[please do not quote signatures on usenet]
>
If you se this:
Error page: <% = request.serverVariables("QUERY_STRING") %>
make sure to filter it first to avoid XSS, and response splitting etc..
I don't se, could you explain?

What is XSS?

Why avoid response splitting?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 15 '07 #7
>
We've got the following problem: When a visitor klicks a dead link he
ends up on a 404-page like should be. On that page there's an
opportunity to mail the webmaster (me) about the missing page. Most
visitors don't describe the link or the page they came from
(containing the dead link) so I really would like to prefill their
email with the URL of the page that seems to be missing.
All ideas are welcome...
Using serverside J[ava]script on a ASP platform:
Error page: <% = request.serverVariables("QUERY_STRING") %>

[please do not quote signatures on usenet]
If you se this:
Error page: <% = request.serverVariables("QUERY_STRING") %>
make sure to filter it first to avoid XSS, and response splitting etc..

I don't se, could you explain?

What is XSS?

Why avoid response splitting?
well if you just print the query string to the html page then a
cunning attacker can form a query string which will print a string to
the page which might steal the cookies of that site (if the user is
logged in) or perform some other attacks.
XSS is cross site scripting, where if you alow the content of your
webpage to be printed to screen as html the attacker can control your
user base. In your example you would validate that the query string
was in the form you expected, before printing it.
Response splitting is where the value of the Location header (which is
send by the server when it wants to redirect the user agent to an
error page - or just to another page) allows code to be injected into
it. Some servers are vulnerable to reponse splitting. Where say a UTF7
encoded strong is sent as the URL to be reidrected to, this UTF string
might have a newline sequence in it which /splits/ the location
header, and allows the injection of completely new headers, which
force the server to return 2 resources instead of just one. This
allows the attacker to get control over the user. It's unlikely
especially if you patch and upgrade your architecture, because this
kind of attack is relatively old as webapp attacks go. But it too
comes from improper validation and filtering before including a URL
string in the location header of a dynamic redirect.

So basically, if you take a value (that could have been supplied by a
user) it must be checked over before being used. Hope thats a bit
clearer. :)
Nov 18 '07 #8
shimmyshack wrote on 18 nov 2007 in comp.lang.javascript:
>>
If you se this:
Error page: <% = request.serverVariables("QUERY_STRING") %>
make sure to filter it first to avoid XSS, and response splitting
etc..

I don't se, could you explain?

What is XSS?

Why avoid response splitting?

well if you just print the query string to the html page
Why woul you do that?
then a
cunning attacker can form a query string which will print a string to
the page which might steal the cookies of that site (if the user is
logged in) or perform some other attacks.
No, cookies live on the client. So the client is free to see them.
XSS is cross site scripting, where if you alow the content of your
webpage to be printed to screen as html the attacker can control your
user base.
So XSS is simply badly thought and written code?

Why do "cross site scripting" at all without adaequate defensive
measures?
In your example you would validate that the query string
was in the form you expected, before printing it.
My example?????????

Sorry, I see no reason to print a querystring, but for debugging.

Are we talking the same language?

Response splitting is where the value of the Location header (which is
send by the server when it wants to redirect the user agent to an
error page - or just to another page)
Who wants to redirect something, the server?

By user agent you mean the browser?

Why not send the requested page in the first place, dear server?
allows code to be injected into it.
What code injected into wat?
Some servers are vulnerable to reponse splitting.
Which servers? and which are not?
Where say a UTF7 encoded strong is sent as the URL to be reidrected to,
???
this UTF string
might have a newline sequence in it which /splits/ the location
header, and allows the injection of completely new headers, which
force the server to return 2 resources instead of just one. This
allows the attacker to get control over the user. It's unlikely
especially if you patch and upgrade your architecture, because this
kind of attack is relatively old as webapp attacks go. But it too
comes from improper validation and filtering before including a URL
string in the location header of a dynamic redirect.

So basically, if you take a value (that could have been supplied by a
user) it must be checked over before being used. Hope thats a bit
clearer. :)
Ah, now we are talking about a "value"?
I suppose you mean a string!

And you want to insert that string into an sql string?

Why didn't you say so in the first place?

We have no problems with that: either use Bob's methods or do a
intelligent input validation on all incoming strings.

These precautions are not limited to your cross-site scripting.

And has nothing to do specifically with redirecting.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 19 '07 #9
On Nov 20, 11:04 am, Bart Van der Donck <b...@nijlen.comwrote:

>
Who wants to redirect something, the server?

The attacker would want to force the server for a reload. But I don't
think shimmyshack is right in regard to the Location-header in this
particular example. You have passed the point of the headers here; you
are in the body of the server response already. Even if a malformed
%0D/%0A/%0D%0A would be decoded as newline, that could not cause any
problems in this case.
of course you are right here! ;) but i included it anyway just in case
someone reading the thread thought their /different/ method of a
redirect using some script which inserted the previous (possibly user
supplied) url as a string into a location header to a 404 reported
script was somehow safer.


Nov 20 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: OnLiner | last post by:
I have a site with hundreds of pages. I often get visits from people who have linked to individual pages and not to the main index page. This means that they do not have the correct...
2
by: dd | last post by:
I have a page that gets info from http header file. I need to develop a page that redirects to this page so the page2 can read header that page1 created. Thing is when I redirect from page1...
1
by: Jack | last post by:
Hello: I have an asp.net program. it imports one file, and does some operations for each row, in each row, it uses transaction, if there are a lot of data in the file, program runs very slow. Then...
0
by: ABC | last post by:
There have ASP.NET application using form authorization. Some buttons of the page will open a new modal windows using javascript "Window,ShowModalDialog". As users logoned the application when...
2
by: robin9876 | last post by:
On an asp.net v1.1 page after saving form information I have a page redirect using response.redirect("aDifferentPage.aspx") This works correctly in development environment connecting from a...
6
snowdonkey
by: snowdonkey | last post by:
Hey! How might I page redirect in PHP similar to how it might be done in JavaScript: window.onload = function Redirect() { window.location = "http://somesite.com"; } Thanks
5
by: ozman | last post by:
Hi, I'm having a problem with delaying a redirect of a page. I created a contact form and if the user does not fill in the fields, I'm echoing the message, but at the same time I want it coming...
2
by: gnewsgroup | last post by:
In my web application, an authenticated user can edit a lot of personal information and then finally can click on Update/Save button to save the info. I did it using MultiView. When the Update...
1
by: zizi2 | last post by:
I have a form that I want to redirect to another page after clicking the submit button. It works well (please see the code below) except that it cancells my pop-up message, it goes the redirected...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.