In 802.11-based wireless local area networks (WLANs), it is difficult to simultaneously attain both high throughput and fairness for multirate traffic. There is a performance anomaly when there are stations whose data rates are much lower than the other stations, in which the aggregate throughput of the high-rate stations drastically degrades. The problem of maximizing the total throughput while maintaining time fairness among the competing stations was studied previously by the same authors. However, our previous solution sacrificed the throughput of low-rate stations. In this paper, we extend our previous work by solving the same optimization problem while maintaining both time fairness and throughput fairness. The optimization problem is formulated as a mixed-integer nonlinear programming problem. The two fairness constraints are maintained by means of changing the channel access probability and transmission time among the competing stations, which can be realized by adjusting their minimum contention window sizes and medium access control (MAC) frame sizes, respectively. A penalty function accompanied with a gradient-based approach is used to solve the problem, and its effectiveness is verified by computational experiments. The proposed solution is also compared with our previous solution in terms of convergence speed and total throughput.