link generation takes SCRIPT_NAME into account.