Do this instead for the echo line:
echo $(basename "$i")
Do this instead for the echo line:
echo $(basename "$i")
The requested URL was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.