• I’m attempting to generate within-page links, in my pages (not posts). In the default WYSIWYG editor, I’ll click the HTML button, and create a link like <a href="#myanchor">. Upon hitting update, WordPress will save it as <a href="http://www.mydomainname.com/myinstalldir/#myanchor">. Now, that’s not good, for a couple reasons.

    1. This page isn’t the root, so this link will exit the current page and go to the index page.
    2. The Blog Address, as specified in the Options panel, is http://www.mydomainname.com, not http://www.mydomainname.com/myinstalldir. myinstalldir is only specified in the WordPress Address.

    My current workaround is to absolutely link to http://www.mydomainname.com/mypage/#myanchor. If I ever change page or domain name I’m going to have to do a massive search and replace, but other than that it mostly works. If there’s a way to generate purely a “#myanchor” link, however, I’d much prefer that.

    Thanks in advance to anyone with some insight on this.

The topic ‘incorrect hyperlink generation: wrong root’ is closed to new replies.