I'm working on my site and as it require users to log in it will be hard to Google to index the sites, because to see 90% of the content you have to be online.So I've made a script which looks for the ip that enters the site if it is between 66.249.66.1 to 66.249.71.206. So if the ip is between this range, i set the google bot as online and it will be able to see all pages a normal user would see.Is this a good idea? Are there more ip ranges? Can I trust these ip ranges?
How to allow Google to index protected content?
seo;google;indexing;authentication
This is not a good idea and no, you cannot trust these IP ranges. The IP addresses used by Google are not public.  But some/most search engine crawlers can be identified by doing a reverse DNS lookup on the IP address.A googlebot example: 66.249.64.0 has a PTR record to crawl-66-249-64-0.googlebot.com, and any IP with a PTR record to a subdomain on googlebot.com is an IP address used by googlebot.What you are doing is showing one set of content to Google and another to the actual user. This is heavily frowned upon and is called cloaking.You should watch Matt Cutts' definitive cloaking video.The best option is to take a subset of that content that you are willing to be publicly visible and make a portion of the site that exposes this content to the search engines and users, and if users want to see more they'll have to login.