Forum Moderators: phranque

Message Too Old, No Replies

.htaccess to Redirect/Block Specific Google Search String

         

potentialgeek

2:53 pm on Aug 6, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Google has recently decided it likes one page on one of my sites based on its heavy weight for one keyword, which we'll call keyword1. Now I find visitors in the last few days arriving from a Google search for the string keyword1 keyword2. These people I don't particularly want on my site. Is there a way to "catch" them and send them away (or deny access, as if you were blocking the IP)?

p/g

jdMorgan

4:09 pm on Aug 6, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, check the HTTP_REFERER header and detect the google search URL and the "unwanted" and "wanted" word combinations in the search query string, and then rewrite those requests to a page that explains that you've got nothing to offer on the combined-keyword subject. Then provide a URL to a modified Google search that won't turn up your site -- Such as using a "Not InURL" advanced search with your site's domain in it, or a different or more-targeted keyword string.

If you don't provide a helpful explanation and easy solution, then many of them will just keep coming back to your site. Whether you want the tone of page to be 'friendly and helpful' or 'cool and efficient' is up to you, but inform these visitors, and they'll be less likely to 'bother you' again.

You could do this with a script on the search-targeted page or with mod_rewrite.

Jim