When a directory in the path to wordpress contains an unusual character, such as +, the redirect after a visitor logs in to post a comment strips that character out of the path name, so user ends up at the 404 not found page.
to reproduce the error:
1. make the directory for wordpress contain a + character, and set wordpress to require visitors to register in order to post comments.:
www.site.com/test+folder/
2. go to post a comment (you must be logged out first).
3. after entering username and password, the page is redirected to www.site.com/testfolder/?p=xx (the + is stripped).
i believe i resolved the error on my site by correcting the regular expression in wp_redirect() in the file wp-includes/pluggable.php.
a diff is attached to this post.