Q. Is it possible, for someone following Halacha to write a will, that will distribute his assets after his death in a different way that the Torah dictates?
A. On question 1912 addressing the question if a secular will written by an attorney valid according to Halacha, we wrote: In principle a secular will, by which an individual estate is divided according to his own wishes and does not follow the dictum of the Torah, may not have any Halachic validity, since it takes effect after the death of the bestower.
According to Halacha, dead people have no rights over the property they owned while they were alive.  Therefore, they have no right to dictate what happens to their property after they die. (Shulchan Aruch C.M. 258: 2).
The above greatly differs from secular law which, in principle, recognizes the right that people have to testamentary independence and can do whatever they want with their property after their demise. 
On question 1913 we added: Some contemporary Poskim indeed maintain that secular wills are Halachically valid based on the principle of dino demalchuso dino, which translates as the law of the kingdom governs This obligation applies mainly in civil law, and not in matters of ritual law.
Igros Moshe, (E.H. 1: 104) mentions: “that although we are dealing with a gift to be made after the death of the donor, and there is no such thing as a gift after death, as the object no longer belongs to the donor and such a gift is therefore not valid in Jewish law, nevertheless, according to the law of the land a person can legally transfer with effect after death money or any other object which at that time obviously no longer belongs to him or her … but in essence it is clear, according to my humble opinion, that a testament of this kind, the dispositions of which will certainly be put into effect by the authorities of the country, does not need a kinyan as one could not imagine a more effective kinyan than this. Hence, since a kinyan is not necessary, the beneficiaries can uphold their right also against those persons who are the proper heirs by Torah law.”
Achiezer (3: 34) also sponsors the principle of dino demalchuso since it makes the receiver a muchzak.
However, a number of Poskim disagree, and follow the opinion of the Remah, that it does not apply in monetary conflicts between two Jewish individuals, for if it would then all the monetary laws of the Torah would become void (Remah C.M. 9: 11, 253: 32) Pischei Choshen H. Yerusha 4: 34).
Binyan Ariel (p. 170), Minchas Yitzchok (6: 164) and other Poskim advise to make a proper tzavaah or testament following Halacha, but at the same time also write a legally executed will, that supports the tzavaah.
There are a number of Halacha ways available whereby one may distribute a significant part of his estate according to his wishes, as long as a certain amount of it is distributed according to the Torah’s laws of inheritance (See Kuntress Mi’Dor l’Dor and Mishapt HaTzava’ah, p. 66.). One should contact a competent Rov or Beis Din familiar also with the Law of the Land, and have them with a lawyer, draw up the required documents. But it is imperative that all changes from the Torah’s laws of inheritance be stipulated and finalized prior to the death of the testator.
Rabbi A. Bartfeld as revised by Horav Dovid Pam, Horav Aharon Miller and Horav Chanoch Ehrentreu Shlit’a.