Hello,
if the href value is "sitename.com/index.php?#anchor", not only "#anchor", then the base href value has no effect!
You need to make sure that the link with anchor is correct, so either you have to:
1. make the link just "#anchor" and make sure the base href setting is correct (the correct in this case would be it is not used!)
2. make the full absolute URL to correct page, that is "
sitename.com/whatever-the-page-url-is#anchror";
how the URL is created - whether it is absolute or relative can be mostly in your WYSIWYG editor configuration