469,267 Members | 1,101 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,267 developers. It's quick & easy.

Grabbing referrer page on a redirected error page

doable?

Here's what we have:

If a page is not found on our site, we redirect to the custom error page.
I'd like to be able to grab the bad link, as well as the referrer page (to
know what page the bad link is on) and then email that information to me so
I can monitor and be alerted to any bad links on the site.

Is there a way to get the referrer even though this is a redirected page?

-Darrel
Nov 18 '05 #1
4 3747
the refer page (if not blocked by a proxy) would only be on the orignal
request to the missing link, you grab it then, before the redirect.

-- bruce (sqlwork.com)

"darrel" <no*****@hotmail.com> wrote in message
news:u3**************@TK2MSFTNGP09.phx.gbl...
doable?

Here's what we have:

If a page is not found on our site, we redirect to the custom error page.
I'd like to be able to grab the bad link, as well as the referrer page (to
know what page the bad link is on) and then email that information to me so I can monitor and be alerted to any bad links on the site.

Is there a way to get the referrer even though this is a redirected page?

-Darrel

Nov 18 '05 #2
HttpContext.Current.Request.UrlReferrer

It's not too reliable, proxy servers commonly rewrite it.
Nov 18 '05 #3
Hi darrel,
I think its doable.

Did u try to get the Referal URL by using

"Request.UrlReferrer" in the aspx page where you are showing the
error !

Hope this helps you to solve the problem.

THanks
Packiyanath.s.k

"darrel" wrote:
doable?

Here's what we have:

If a page is not found on our site, we redirect to the custom error page.
I'd like to be able to grab the bad link, as well as the referrer page (to
know what page the bad link is on) and then email that information to me so
I can monitor and be alerted to any bad links on the site.

Is there a way to get the referrer even though this is a redirected page?

-Darrel

Nov 18 '05 #4
HttpContext.Current.Request.UrlReferrer

It's not too reliable, proxy servers commonly rewrite it.


Perfect. That was easier than I thought!

Well, to be fair, it works locally...we'll see how well it does on the
transfer over to the load balanced servers... ;o)

-Darrel
Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Srinivasan | last post: by
7 posts views Thread by Yongsub Eric Shin | last post: by
reply views Thread by Mark Phanides | last post: by
6 posts views Thread by dee | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.