It is possible, but difficult. Whereas normal baking requires only a few ingredients, GF baking requires many. Replacing the flour would require mixing several different GF flours such as rice, tapioca, sorghum, potato and also adding things like xanthan gum just to begin to get a good texture. One thing that I've had luck with is adding a small amount of yogurt into the mix to combat the dry crumbly texture that is so common with GF cookies.
I'd suggest checking out some of the online GF recipe sites to see what they are doing with their recipes. A good one is GlutenFreeda:
http://www.glutenfreeda.com
Again, it is possible but it is going to be an adventure to say the least. Good luck.