Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#11763 closed Bug (invalid)

Incorect anchor targeting for pages with canonical path not same as base path.

Reported by: macik Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

Bug related to «Link» plugin code and it's appearance.

Use CKeditor in some CMS, where pages had canonical path differ from base path of page. In these cases anchor links (#anchor) set in editor points to wrong page and cause 404 error.

As example (part of page code):

<base href="http://site.com/somepath/" />
<link rel="canonical" href="http://site.com/somepath/news/page">

Trying to set up some #test anchor on such page I get anchor directs to incorrect «site.com/somepath/#test» rather than correct «site.com/somepath/news/page#test».

So I must manually type full link address (news/page#test) to get working one anchor.

Change History (3)

comment:1 Changed 5 years ago by Jakub Ś

Keywords: link anchor base href canonical removed
Resolution: invalid
Status: newclosed
Version: 4.3

Use CKeditor in some CMS, where pages had canonical path differ from base path of page.

Bugs need to be replicated in plain CKEditor and not on e.g. CMS. Is it possible to replicate this issue in editor e.g. full page or inline mode?

You are saying that <link rel="canonical should be taken into account instead of base tag. I don't think this is valid. Canonical links were created for Web Crawlers to eliminate duplicate content issues and not to instruct browser how to navigate through page.

Trying to set up some #test anchor on such page I get anchor directs to incorrect «site.com/somepath/#test» rather than correct «site.com/somepath/news/page#test».

In my case when I have tested it, Anchors contained only e.g. #top and they were added at the end of page despite base tag used.

Perhaps your CMS is putting invalid URL into anchor tags (with missing prefix after basePath).

I'm closing this issue as I don't think it is valid but if you have remarks, plain CKEditor test case to show me, even link explaining that you are right, please provide it and i will consider reopening this issue.

Some links:

comment:2 Changed 5 years ago by macik

Ok. Let's forget about «canonical» tag. It's not really important for this case.

I speak about «base» tag can point to other path than actual page address.

Assume we load http://site.com/somepage.html and base tag is:

<base href="http://site.com/somepath/" />

In that case anchor will point to http://site.com/somepath/#anchor and we fails to open it.

comment:3 Changed 5 years ago by Jakub Ś

I'm sorry but this is still incorrect. If use base tag and anchors as you have described it you will get same problems on native page used without CKEditor.

<p><a id="top" name="top"></a></p>

//... some HTML

<p><a href="#top">#top</a></p>
Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy