For and to are both confusing prepositions in English. Please help me in the following sentence:
It will be fun for you.
It will be fun to you.
Do both sentences have the meaning or not?
When should either sentence be used?
The normal preposition is fun for someone, so the short answer is OP's example #1 is correct, and #2 is "invalid".
But as an illustration of a potential distinction in similar contexts,...
1: This isn't fun for me
This isn't entertaining me / I'm not enjoying it
2: This isn't fun to me
might tend to imply
This isn't the kind of thing I would call "fun"
In that second case, maybe the speaker himself isn't even participating (he's just offering an opinion). But it's important to note that the (relatively small) difference in meaning isn't inherently conveyed by the specific preposition to as such. It's more that the average native speaker expects for, so when he hears to he has to think of some slight difference in nuance that could reasonably apply.
Also note that whereas in the specific examples above, any difference in meaning is both small and not universally recognised, there's a clear-cut distinction if we switch to...
3: He is good for me
4: He is good to me
...where #3 means Being with him improves me as a person (perhaps he even treats me harshly, but that's good for me because I need to learn discipline). But #4 means He's generous to me / treats me well. And all native speakers would recognise that distinction - there's no hint of "non-standard preposition must imply non-standard meaning" there - both usages are completely "standard", with well-known different meanings.