Added basename() to fix path error when using reverse proxy or non-root directory installation