Does anyone know a reliable way to check whether the referrer of a HTTP request was a search engine or not?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here is a Django middleware object that offers this functionality: http://djangosnippets.org/snippets/197/ . The logic can be extracted to work in a non-Django Python setting.
The method used here is to check the referring url to determine if it matches a given pattern (the presence of a parameter ‘q’, for example).