Optimization of a fixed-bed bioreactor used in wastewater treatment is addressed. The objective of the optimization is to maximize the treatment efficiency of the biofilter by manipulating the feed flowrate whilst satisfying operational constraints. Numerical results indicate that the optimal input is characterized as being on the boundary of the admissible region. Thus, the characterized optimal solution is implemented using a simple feedback control law, which provids the optimal input profile despite variations in substrate inlet concentration and biomass growth rate.