Opened 12 years ago
Closed 11 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)
#2
@
12 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:
- Created a new Multisite install (in subdirectory mode).
- Pasted this into a new post:
<a href="#test">test</a>
. - Published the post, viewed in on the front-end.
- 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.
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