Detect if page was requested from a search engine page

I have an ASP.NET development web site that I can't keep off the search engines. Is there a way I can detect if the site was reached via a search engine? if so I want to redirect to the production site. Thanks
LVL 8
Bob HoffmanDeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

plusone3055Commented:
yes
 there are several analytics packages that can do this for you
Google Analytics
being one of them :)

http://www.google.com/analytics/
0
Bob HoffmanDeveloperAuthor Commented:
I'd rather handle it on my own. I want to detect any non-direct hit to a page not just from google. Thanks
0
plusone3055Commented:
may i ask why do you want to take that approach as opposed to
 somthing thats available to you for free use ?
0
Become a Leader in Data Analytics

Gain the power to turn raw data into better business decisions and outcomes in your industry. Transform your career future by earning your MS in Data Analytics. WGU’s MSDA program curriculum features IT certifications from Oracle and SAS.  

plusone3055Commented:
a colleague of mine suggests you take a look at motion tracker  its ASP.NET built
you can probably modify it to your needs :)

http://motiontracker.codeplex.com/
0
Bob HoffmanDeveloperAuthor Commented:
The site already has a ton of Google Analytics code in it, I don't want to interfere with. The dev site an exact copy of the production site, when changes are made the site is moved in it's entirety to production. I want something that sits in the global.asax file that will look at the request and redirect it if's an indirect request for a dev server page. Motion tracker is way over-kill for what I'm trying to do. Thanks
0
Bob HoffmanDeveloperAuthor Commented:
server variable "HTTP_REFERER" and "HTTP_X_FORWARDED_FOR" from the request object will tell you if the page request came from a search engine.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bob HoffmanDeveloperAuthor Commented:
found the solution on my own
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.