There are at least 3 different topics in this post, so lets take them one by one:
Optimal preflop strategy with AA
In general AA should always be raised or reraised preflop, since it is after all the nuts, and putting in chips with the nuts is always +EV. However that does not mean, the optimal strategy is to move all-in, since it depends on, how many chips are in the pot already. If we start the hand with 100BB, and we are first to act, then open shipping for those 100BB is not a very good strategy, since good players are just going to fold, unless they have KK or the other AA.
Did you make a mistake because you got unlucky
You give an example, where you went all in with AA preflop, got called and lost. You then apparently see this as an indication, you should have played differently. But this is complete and utter nonsense. The goal in poker is not to win the hand, but to get the chips in with an edge. So you got the perfect result here, and you should be over the moon with excitement, that he called with 87o. There is sooooo much of this results oriented bullshit in poker forums. People whine like little babyes, whenever their aces got cracked or they suffered some other kind of bad beat. But they never worry or complain about the same hands, when they win them. Stop being one of those cry-babies and take the game and yourself serious.
Is online poker rigged
Short answer: No. If you fail to win online, its because, you are not taking it serious enough, which your post certainly indicate. Or you are not putting in enough volume. There is variance in poker, so nobody can except to sit down and play 5 tournaments and then always show a profit. Thats just not how the game works.