Reversing port rotation directions of ship routes is a practical alteration of container liner shipping networks. The port rotation directions of ship routes not only affect the transit time of containers, as has been recognized by the literature, but also the shipping capacity and transshipment cost. This paper aims to obtain the optimal port rotation directions that minimize the generalized network-wide cost including transshipment cost, slot-purchasing cost and inventory cost. A mixed-integer linear programming model is proposed for the optimal port rotation direction optimization problem and it nests a minimum cost multi-commodity network flow model. The proposed model is applied to a liner shipping network operated by a global liner shipping company. Results demonstrate that real-case instances could be efficiently solved and significant cost reductions are gained by optimization of port rotation directions.