Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing Slash Issue In Joomla 5.1 Canonical Homepage #43294

Open
Geoffresh opened this issue Apr 17, 2024 · 7 comments
Open

Trailing Slash Issue In Joomla 5.1 Canonical Homepage #43294

Geoffresh opened this issue Apr 17, 2024 · 7 comments

Comments

@Geoffresh
Copy link

Steps to reproduce the issue

In the SEF plugin, set "enforce URLS without trailing slash" and inspect the homepage and a sub page (example.com and example.com/page1). Notice that the canonical is correct for example.com/page1 but example.com has a canonical with a trailing slash.

Expected result

Canonical follows the URL without trailing slash.

Actual result

URLs follow the correct non trailing slash while the canonical for the homepage contains the trailing slash.

System information (as much as possible)

Joomla 5.1

Additional comments

I am happy to say that I've successfully updated to Joomla 5.1 on my website. I can see from the release notes that there are some SEO items for the SEF plugin that have been added.
https://www.joomla.org/announcements/re ... -here.html

Specifically this one about the trailing slash.
#42702

This works great! However, I am noticing a strange issue with the homepage canonical now. It is still generating a URL to have a trailing slash even though all of the URLs are supposed to not have the trailing slash. For example. If in the SEF plugin you set "enforce URLS without trailing slash" that works for the URLs in subfolders, but not for the domain. So in the browser you will see https://example.com but for the canonical you will see "https://example.com"

@rfmjoe
Copy link

rfmjoe commented Apr 17, 2024

as far as i know, joomla core hat no "canonical" link feature built in. So this might rely to the plugin/component you are using maype?

@Geoffresh
Copy link
Author

Hi rfmjoe,

Thank you for your response. The plugin actually does have this feature. When you access this plugin, place your domain in the "Site Domain" field (without the trailing slash) and you'll see that your pages now generate a canonical tag in the HTML.

Thank you,
Geoffrey


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43294.

@richard67
Copy link
Member

@Geoffresh You are right that the setting exists. But it doesn't mean a cannonical URL functionality like it is e.g. provided by some 3rd party SEO extensions, it means only a cannonical domain, i.e. if the site can be reached with different domains, the configured domain is used for the cannonical URL, but the rest of the current URL is just the current URL.

This was discussed here many times, see e.g. this comment here: #9785 (comment) .

This just for clarification and your understanding.

Don't get me wrong: I don't say that your issue is expected behavior.

If it is really like you write that you got redirected to the right URL without trailing slash but the cannonical tag still points to the URL with trailing slash, then this isa bug, I think. But I'm not an expert on our routing or the SEF plugin, so I might be wrong.

@Geoffresh
Copy link
Author

Hi Richard,

Thank you for your response. Yes, this is like I describe so it must be a bug. Please see the attached screenshot.
Screenshot 2024-04-18 at 8 04 23 AM

@Geoffresh
Copy link
Author

Out of curiosity, is this something that the Joomla core team will work on? Is there a process to submit this for consideration? I'm just not sure what the next steps would be to advocate for this.

Thank you

@richard67
Copy link
Member

Wait until someone makes a pull request for it, or if you have an idea how to solve it make a pull request yourself.

@universewrld
Copy link

universewrld commented Apr 30, 2024

I don't say that your issue is expected behavior.

yes, no one expects this plugin to work like this, which means this @joomla plugin is not working properly.

rel=“canonical” should never point to non-canonical references.

a canonical domain does not exist at all in @google definitions, but a canonical link does exist
(for example, if you have 2 domains, then there is only one canonical link on one domain, and not several on one domain, as this plugin currently generates)

I also recently talked about the problem with this plugin #42720
and I suggested making a global SEF setting for this plugin #43331

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants