#286: use PageNotFound
rawcode: redirect when it is directory
fixed broken test