Grabbing referrer page on a redirected error page

D

darrel

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
 
B

bruce barker

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)
 
G

Guest

HttpContext.Current.Request.UrlReferrer

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

Guest

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
 
D

darrel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top