How can I avoid phlebitis on the legs?

Depends. It depends on what level of venous disease you have. It also depends on what you are doing. If you have significant venous disease and are travelling in an airplane you should wear compression stockings. These should also be worn for long car rides. You should stand up and walk every 2 hrs. In an airplane. In a car you should stop and walk every 2 hours.