definition of or definition for

Both:

  1. What’s your definition of happiness?

  2. I need a definition for this word.

are correct.

Note should be taken of the fact that with definite determiners (in this case "your") the preposition "of" will be preferred, while with an indefinite determiner (in this case "a") the preposition "for" can be used. It should also be taken into account that "of" is much more usual than "for", which will only be accepted in restricted contexts such as (2) above.

According to Seth Lindstromberg in English Prepositions Explained, while "of" expresses referential possession (the word has a definition) or a verb-object relationship (the word is defined), "for" expresses purpose (I want a definition for the purpose of defining this word).

Something similar can happen with other nouns, for example "solution":

  • The solution of the problem is ...
  • A solution for the problem could be ...

Here is a good reply concerning the degree of idiomaticity of "a solution for" as compared with "a solution to" (in answer to to Ram Pillai's comment below).