1

So my website has a page called presets_pc.html, which dynamically loads content, and I want to redirect bots to presets_pc_fallback.php, which literally dumps the database on the page. I'm pretty new to this stuff, and can't get RewriteRule to work; can you help me?

Thanks :)

dosse91214
  • 561
  • 1
  • 5
  • 17

1 Answers1

2

The way you can tell whether a bot is accessing your site is through the User-Agent HTTP request header. Anyone can spoof what that is so there's no real guarantee. If you have a list of bots you want to affect, you can look up the "exclusion" user agents from a site like robotstxt and chain them into a RewriteCond match.

For example, google, infoseek, msn:

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (googlebot|InfoSeek|msnbot) [NC]
RewriteRule ^/?presets_pc\.html$ /presets_pc_fallback.php [L,R]
Jon Lin
  • 142,182
  • 29
  • 220
  • 220