Active link not working on sub directories

Have a look at this topic and particularly this answer (if you want to set the active class dynamically).