Jump to content

How to spoof your useragent as googlebot with php- curl or file_get_contents


fapapfap

Recommended Posts

Don't pretend to be google, be your browser, people know you are not google by the ip.

 

Here is a few different methods, if need a different user-agent string, look them up

 

for curl:

curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT x.y; Win64; x64; rv:10.0.1) Gecko/20100101 Firefox/10.0.1');

 

in htaccess:

php_value user_agent Mozilla/5.0 (Windows NT x.y; Win64; x64; rv:10.0.1) Gecko/20100101 Firefox/10.0.1

 

within a php script:

ini_set('user_agent', 'Mozilla/5.0 (Windows NT x.y; Win64; x64; rv:10.0.1) Gecko/20100101 Firefox/10.0.1');

 

for file_get_contents you use the ini_set() above

 

Don't pretend to be google, be your browser, people know you are not google by the ip.

 

Here is a few different methods, if need a different user-agent string, look them up

 

for curl:

curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT x.y; Win64; x64; rv:10.0.1) Gecko/20100101 Firefox/10.0.1');

 

in htaccess:

php_value user_agent Mozilla/5.0 (Windows NT x.y; Win64; x64; rv:10.0.1) Gecko/20100101 Firefox/10.0.1

 

within a php script:

ini_set('user_agent', 'Mozilla/5.0 (Windows NT x.y; Win64; x64; rv:10.0.1) Gecko/20100101 Firefox/10.0.1');

 

for file_get_contents you use the ini_set() above

 

Hi thank you for that, exactly what I was looking for!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.