During performing multiple tasks of a redundant manipulator, the obstacles affect the sequential order of task areas and the joint trajectories. The end-effector is constrained to visit multiple task areas with an optimal anti-collision path, while the joints are required to move smoothly and avoid predefined obstacles. A special encoding genetic algorithm (SEGA) is proposed for multitask-based anti-collision trajectory planning. Firstly, the spatial occupancy relationship between obstacles and manipulator is developed utilizing the theory of spherical enclosing box and spatial superposition. The obstacles are detected according to the relative position relationship between linear segments and spheres. Secondly, each joint trajectory between adjacent task areas is depicted with a sixth-degree polynomial. Additionally, each joint trajectory is improved via optimizing the unknown six-order coefficient. By searching for optimal sequential order of task areas, optimal collision detection results, and optimal joint trajectories, the multitask-based anti-collision trajectory planning problem is transformed into a parameter optimization problem. In SEGA, the cost function consists of two parts, including the end-effector path length and the variation of joint angles. Moreover, each chromosome consists of three categories of genes, including the sequential order of task areas, the sequential order of joint configurations corresponding to task areas, and the unknown coefficients for anti-collision joint trajectories. Finally, numerical simulations are carried out to verify the proposed method.