WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#23453 closed defect (bug) (worksforme)

Absolute path added to same page anchor tag links

Reported by: angio Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5.1
Component: Permalinks Keywords: reporter-feedback
Focuses: multisite 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 (4)

#1 @angio
9 years ago

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

#2 @SergeyBiryukov
9 years ago

  • 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.

#3 @jeremyfelt
8 years ago

  • Component changed from Multisite to Permalinks
  • Focuses multisite added
  • Milestone Awaiting Review deleted

Closing as we need feedback on the reported issue. Please feel free to reopen if needed.

#4 @samuelsidler
8 years ago

  • Resolution set to worksforme
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.