I fiddled with this for a while and came upon a solution that works for me.
1) Change your template metadata tag to: {metadata showbase="false"}
2) Uncheck "Generate relative urls" in the TinyMCE advanced tab.
3) Follow the instructions
here:
Starting at line 65 [of modules/TinyMCE/templates/tinyconfig.tpl], you'll see:
{if $relativeurls=="true"}
relative_urls : true,
remove_script_host : true,
{else}
relative_urls : false,
remove_script_host : false,
{/if}
Change the second occurrence of remove_script_host from false (bold above) to true, so that the script host is always removed.
4) The above 3 steps fix the anchor issues, but now when using cms_selflink in TinyMCE the links come out like:
http://www.site.com/www.site.com/page/link due to the absolute href created by Tiny and the full path created by cms_selflink.
I decided the easiest way was to kill the cms_selflink creation by Tiny. I edited
modules/TinyMCE/TinyMCE.module.php and changed line 451 from:
tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href=\"{cms_selflink href=\'" . $entry->Alias() . "\' ".$additions."}\">'+sel+'</a>');";
to:
tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href=".$entry->GetURL().">'+sel+'</a>');";
This BYPASSES cms_selflink completely and creates a standard href URL. This is OK by me, but maybe not for some. Now both creating anchors and using the cms_selflink dropdowns in Tiny work as they should.
Thoughts? Hope this helps someone!