Our company has temp development urls that are being indexed by search engines. We need to get this to stop via a global htaccess file. By global, i mean i want to drop this access into our root that will apply the rules for each site. Every time we build a new site, i don't want to drop a htaccess file in that folder.
I am terrible at writing htaccess rules, otherwise i would have done it myself. I would appreciate any input from the community.
Here is an example temp url: 1245.temp.oursite.com
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} AltaVista [OR]
RewriteCond %{HTTP_USER_AGENT} Googlebot [OR]
RewriteCond %{HTTP_USER_AGENT} msnbot [OR]
RewriteCond %{HTTP_USER_AGENT} Slurp
RewriteRule ^.*$ "http\:\/\/oursite\.com" [R=301,L]
I've tried playing with this, but like i stated above, i'm terrible at writing htaccess rules.
Edit The question is similar to this one, however mine involves sub-domains.