Upon later inspection and chance circumstances, I found an extremely easy solution to this problem. In the code for the share button I used:
<div class="fb-share-button" data-href="http://mywebsite.org/index.php" data-type="button">
Changing the data-href link to my website's homepage to include "/index.php" did the trick. I had tried webpage.com/index but not index.php but it is working now. If anyone has the same problem I would suggest trying that.