Opened 3 months ago

Last modified 3 months ago

#23453 new defect (bug)

Absolute path added to same page anchor tag links

Reported by: angio Owned by:
Priority: normal Milestone: Awaiting Review
Component: Multisite Version: 3.5.1
Severity: normal Keywords: reporter-feedback
Cc:

Description

In a multisite setup with a sub-folder configuration when I create a link with a hash tag to an anchor point on the same page, the rendered HTML includes the absolute path plus the hash tag.

When I tested creating a same page link with a hash tag on a regular install it worked fine. This might have to do with re-writes using sub-folders in multisite. I don't think it should be adding the absolute path into the href

Change History (2)

The absolute path is only showing up when the hashtag # is present. If I open a link such as <a href="test"> it's fine when I open a link as in <a href="#test"> it add's the entire permalink of the page before the # including a trailing slash so the link appears as http://www.example.com/page-name/#test

  • Keywords reporter-feedback added; 2nd-opinion removed

the rendered HTML includes the absolute path plus the hash tag.

Could not reproduce. My steps:

  1. Created a new Multisite install (in subdirectory mode).
  2. Pasted this into a new post: <a href="#test">test</a>.
  3. Published the post, viewed in on the front-end.
  4. Viewed the page source. The link is unchanged: <a href="#test">test</a>.

Replying to angio:

when I open a link as in <a href="#test"> it add's the entire permalink of the page before the # including a trailing slash so the link appears as http://www.example.com/page-name/#test

That's standard browser behaviour for relative links. The URL is added by browser, not by WordPress.

Note: See TracTickets for help on using tickets.