Last post Oct 30, 2009 09:22 AM by rtpHarry
Oct 30, 2009 04:53 AM|tezmc|LINK
I'm changing the domain name of my website, and will be redirecting users from the old site, to the new with a 301 redirect. Is there anyway I can check if a user has come to the new site through the redirect?
I want to be able to show a thickbox popup explaining why they have been redirected. I tried checking the referrer, but it seems to be blank.
Any help would be much appreciated.
Oct 30, 2009 09:22 AM|rtpHarry|LINK
I would have thought that this is the way you would do it.
What technology are you using to perform the 301?
Sometimes the referrer can be stripped by security programs so that could explain why its empty.
Another option is to redirect and append a querystring in the redirect so you can detect it that way. Something like:
redirect from oldsite to http://www.example.com/?Source=OldSite
then in the new site have some code in your page load:
if(!IsNullOrEmpty(Request.QueryString["Source"]) && Request.QueryString["Source"].Equals("OldSite"))
// show a message
LabelSiteNameChanged.Visible = true;