A little more info:
I was looking through various other posts on somewhat similar issues, and I attempted to do what one suggested: I set permalinks back to default, and this made the links on the main page work. Unfortunately, changing them back to %postname% broke the posts and pages again. Can anybody tell me why permalink setting is causing this issue? And how to fix it?
Thanks!