Update urls to work with friendly urls enabled, and fix for older versions of php