By Christopher Ambler on Saturday, 31 October 2020
Posted in Technical Issues
Replies 5
Likes 0
Views 8.9K
Votes 0
It would seem that any page that uses the frontpage view picks up the wrong canonical URL.

In views.php, the URL being passed in for such pages has the option but no more information. It is then routed to the appropriate menu item. In my case, that's the one with the alias of "entry." Whether I pick default or a specific menu ID, it always picks up SOME menu item.

But since this is the home page of the site, the canonical URL should not have a path. It should be the root url.

Here is some debug output I made in views.php:

Pre URL: index.php?option=com_easyblog
Post URL: https://www.retrograde.today/entry

As you can see, the URL in is the component only, as it is coming from my home page which is of type Easyblog/frontpage.

The canonical URL being set should be simply https:/http://www.retrograde.today

--

The IDEAL solution would be an option on the menu item to OVERRIDE the canonical URL for that menu item. I'd then set it to the URL for the site and be done.

Either way, the canonical URL as set now is wrong.
I am sorry for the delayed of this reply,

I did not notice you have show any debug output on the Easyblog page.

By the way, do you mean that your current menu structure have 2 Easyblog frontpage menu item and one of the frontpage menu item is set it as default homepage right?

After that, the homepage canonical link will show site.com/alias instead of site.com root URL?
·
Monday, 02 November 2020 10:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Correct. The home page of the site is an EasyBlog homepage view.

I also have a hidden menu item called "entry" that is also a homepage view and is the ItemID I use for pinning entries (using set item ID option).

That's the one that is always picked for the canonical URL, even on the public homepage menu item.

The debug output is the "Pre URL and Post URL" lines - I did an echo of those variables to see what they are.
·
Monday, 02 November 2020 10:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Alright, got it now.

I will log into issue tracker.
·
Monday, 02 November 2020 17:59
·
0 Likes
·
0 Votes
·
0 Comments
·
I was facing the same issue and i used a plugin dealing with canonical links for removing the wrong canonical on my index.
·
Friday, 06 November 2020 18:00
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for sharing Chaon.
·
Friday, 06 November 2020 18:40
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post